remove (or attempt to remove) requirement for holding process lock when changing connections
git-svn-id: svn://localhost/ardour2/branches/3.0@8110 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
f3a833e38e
commit
979a61eb3f
@ -179,7 +179,6 @@ class AudioEngine : public SessionHandlePtr
|
||||
void update_total_latency (const Port&);
|
||||
|
||||
Port *get_port_by_name (const std::string &);
|
||||
Port *get_port_by_name_locked (const std::string &);
|
||||
|
||||
enum TransportState {
|
||||
TransportStopped = JackTransportStopped,
|
||||
|
@ -847,8 +847,6 @@ AudioEngine::unregister_port (Port& port)
|
||||
int
|
||||
AudioEngine::connect (const string& source, const string& destination)
|
||||
{
|
||||
/* caller must hold process lock */
|
||||
|
||||
int ret;
|
||||
|
||||
if (!_running) {
|
||||
@ -864,8 +862,8 @@ AudioEngine::connect (const string& source, const string& destination)
|
||||
string d = make_port_name_non_relative (destination);
|
||||
|
||||
|
||||
Port* src = get_port_by_name_locked (s);
|
||||
Port* dst = get_port_by_name_locked (d);
|
||||
Port* src = get_port_by_name (s);
|
||||
Port* dst = get_port_by_name (d);
|
||||
|
||||
if (src) {
|
||||
ret = src->connect (d);
|
||||
@ -890,8 +888,6 @@ AudioEngine::connect (const string& source, const string& destination)
|
||||
int
|
||||
AudioEngine::disconnect (const string& source, const string& destination)
|
||||
{
|
||||
/* caller must hold process lock */
|
||||
|
||||
int ret;
|
||||
|
||||
if (!_running) {
|
||||
@ -906,8 +902,8 @@ AudioEngine::disconnect (const string& source, const string& destination)
|
||||
string s = make_port_name_non_relative (source);
|
||||
string d = make_port_name_non_relative (destination);
|
||||
|
||||
Port* src = get_port_by_name_locked (s);
|
||||
Port* dst = get_port_by_name_locked (d);
|
||||
Port* src = get_port_by_name (s);
|
||||
Port* dst = get_port_by_name (d);
|
||||
|
||||
if (src) {
|
||||
ret = src->disconnect (d);
|
||||
@ -974,30 +970,22 @@ Port *
|
||||
AudioEngine::get_port_by_name (const string& portname)
|
||||
{
|
||||
string s;
|
||||
if (portname.find_first_of (':') == string::npos) {
|
||||
s = make_port_name_non_relative (portname);
|
||||
} else {
|
||||
s = portname;
|
||||
}
|
||||
|
||||
Glib::Mutex::Lock lm (_process_lock);
|
||||
return get_port_by_name_locked (s);
|
||||
}
|
||||
|
||||
Port *
|
||||
AudioEngine::get_port_by_name_locked (const string& portname)
|
||||
{
|
||||
/* caller must hold process lock */
|
||||
|
||||
if (!_running) {
|
||||
if (!_has_run) {
|
||||
fatal << _("get_port_by_name_locked() called before engine was started") << endmsg;
|
||||
fatal << _("get_port_by_name() called before engine was started") << endmsg;
|
||||
/*NOTREACHED*/
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (portname.find_first_of (':') == string::npos) {
|
||||
s = make_port_name_non_relative (portname);
|
||||
} else {
|
||||
s = portname;
|
||||
}
|
||||
|
||||
if (portname.substr (0, jack_client_name.length ()) != jack_client_name) {
|
||||
/* not an ardour: port */
|
||||
return 0;
|
||||
|
@ -194,11 +194,13 @@ Diskstream::handle_input_change (IOChange change, void * /*src*/)
|
||||
{
|
||||
Glib::Mutex::Lock lm (state_lock);
|
||||
|
||||
if (change.type & IOChange::ConfigurationChanged) {
|
||||
if (!(input_change_pending.type & change.type)) {
|
||||
input_change_pending.type = IOChange::Type (input_change_pending.type | change.type);
|
||||
_session.request_input_change_handling ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Diskstream::non_realtime_set_speed ()
|
||||
|
@ -159,13 +159,10 @@ IO::check_bundles (std::vector<UserBundleInfo*>& list, const PortSet& ports)
|
||||
int
|
||||
IO::disconnect (Port* our_port, string other_port, void* src)
|
||||
{
|
||||
assert (!AudioEngine::instance()->process_lock().trylock());
|
||||
|
||||
if (other_port.length() == 0 || our_port == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
Glib::Mutex::Lock lm (io_lock);
|
||||
|
||||
@ -196,8 +193,6 @@ IO::disconnect (Port* our_port, string other_port, void* src)
|
||||
int
|
||||
IO::connect (Port* our_port, string other_port, void* src)
|
||||
{
|
||||
assert (!AudioEngine::instance()->process_lock().trylock());
|
||||
|
||||
if (other_port.length() == 0 || our_port == 0) {
|
||||
return 0;
|
||||
}
|
||||
@ -343,8 +338,6 @@ IO::add_port (string destination, void* src, DataType type)
|
||||
int
|
||||
IO::disconnect (void* src)
|
||||
{
|
||||
BLOCK_PROCESS_CALLBACK ();
|
||||
|
||||
{
|
||||
Glib::Mutex::Lock lm (io_lock);
|
||||
|
||||
|
@ -122,8 +122,6 @@ Port::get_connections (std::vector<std::string> & c) const
|
||||
int
|
||||
Port::connect (std::string const & other)
|
||||
{
|
||||
/* caller must hold process lock */
|
||||
|
||||
std::string const other_shrt = _engine->make_port_name_non_relative (other);
|
||||
std::string const this_shrt = _engine->make_port_name_non_relative (_name);
|
||||
|
||||
@ -149,8 +147,6 @@ Port::connect (std::string const & other)
|
||||
int
|
||||
Port::disconnect (std::string const & other)
|
||||
{
|
||||
/* caller must hold process lock */
|
||||
|
||||
std::string const other_shrt = _engine->make_port_name_non_relative (other);
|
||||
std::string const this_shrt = _engine->make_port_name_non_relative (_name);
|
||||
|
||||
|
@ -69,6 +69,8 @@ Track::get_state ()
|
||||
return state (true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
XMLNode&
|
||||
Track::get_template ()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user