diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-11-27 15:51:58 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-11-27 15:51:58 +0000 |
commit | 7df2aa24c98fcb52805d9b70466103e0e88124f9 (patch) | |
tree | eb120aad68e6cf1815b2f19ee39df5806491e37c /gtk2_ardour/io_selector.cc | |
parent | c542d5421d2bd82b8ca91ba225bb03d64337757d (diff) |
move process lock taking to avoid deadlock when connecting ports
git-svn-id: svn://localhost/ardour2/branches/3.0@8104 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/io_selector.cc')
-rw-r--r-- | gtk2_ardour/io_selector.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc index f3bc947355..8677d85e47 100644 --- a/gtk2_ardour/io_selector.cc +++ b/gtk2_ardour/io_selector.cc @@ -136,7 +136,6 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s) ARDOUR::Bundle::PortList const & our_ports = c[_ours].bundle->channel_ports (c[_ours].channel); ARDOUR::Bundle::PortList const & other_ports = c[_other].bundle->channel_ports (c[_other].channel); - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock()); for (ARDOUR::Bundle::PortList::const_iterator i = our_ports.begin(); i != our_ports.end(); ++i) { for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) { @@ -145,12 +144,16 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s) if (!f) { return; } - - if (s) { - _io->connect (f, *j, 0); - } else { - _io->disconnect (f, *j, 0); - } + + { + Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock()); + + if (s) { + _io->connect (f, *j, 0); + } else { + _io->disconnect (f, *j, 0); + } + } } } } |