Make ScopedConnectionList's mutex non-static so that one

list's destruction can cause another without a
deadlock.


git-svn-id: svn://localhost/ardour2/branches/3.0@12279 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-05-15 00:06:06 +00:00
parent 14a86aaccc
commit 32bed9aaf0
2 changed files with 2 additions and 9 deletions

View File

@ -130,12 +130,7 @@ class ScopedConnectionList : public boost::noncopyable
/* this class is not copyable */
ScopedConnectionList(const ScopedConnectionList&);
/* this lock is shared by all instances of a ScopedConnectionList.
We do not want one mutex per list, and since we only need the lock
when adding or dropping connections, which are generally occuring
in object creation and UI operations, the contention on this
lock is low and not of significant consequence. Even though
boost::signals2 is thread-safe, this additional list of
/* Even though our signals code is thread-safe, this additional list of
scoped connections needs to be protected in 2 cases:
(1) (unlikely) we make a connection involving a callback on the
@ -146,7 +141,7 @@ class ScopedConnectionList : public boost::noncopyable
one from another.
*/
static Glib::StaticMutex _lock;
Glib::Mutex _lock;
typedef std::list<ScopedConnection*> ConnectionList;
ConnectionList _list;

View File

@ -22,8 +22,6 @@
using namespace PBD;
Glib::StaticMutex ScopedConnectionList::_lock = GLIBMM_STATIC_MUTEX_INIT;
ScopedConnectionList::ScopedConnectionList()
{
}