diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-04 16:09:14 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:39 -0400 |
commit | aa80321976726b745741ce525f2b1b1becb29671 (patch) | |
tree | 653efdc99c8ccca3b15563b7e3e29ec41c97032c | |
parent | cd6a88d0d4d925be253f1cc394236b7a27909547 (diff) |
fix deadlock caused by VCA=>VCA slaving and set_state()
-rw-r--r-- | libs/ardour/vca_manager.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libs/ardour/vca_manager.cc b/libs/ardour/vca_manager.cc index c8e3a009e4..9a96dc8a38 100644 --- a/libs/ardour/vca_manager.cc +++ b/libs/ardour/vca_manager.cc @@ -140,13 +140,18 @@ VCAManager::set_state (XMLNode const& node, int version) XMLNodeList const & children = node.children(); VCAList vcal; - { - - Mutex::Lock lm (lock); - - for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { - if ((*i)->name() == VCA::xml_node_name) { - boost::shared_ptr<VCA> vca = boost::shared_ptr<VCA> (new VCA (_session, **i, version)); + for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { + if ((*i)->name() == VCA::xml_node_name) { + boost::shared_ptr<VCA> vca = boost::shared_ptr<VCA> (new VCA (_session, **i, version)); + + /* can't hold the lock for the entire loop, + * because the new VCA maybe slaved and needs + * to call back into us to set up its own + * slave/master relationship + */ + + { + Mutex::Lock lm (lock); _vcas.push_back (vca); vcal.push_back (vca); } |