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:
parent
14a86aaccc
commit
32bed9aaf0
|
@ -130,12 +130,7 @@ class ScopedConnectionList : public boost::noncopyable
|
||||||
/* this class is not copyable */
|
/* this class is not copyable */
|
||||||
ScopedConnectionList(const ScopedConnectionList&);
|
ScopedConnectionList(const ScopedConnectionList&);
|
||||||
|
|
||||||
/* this lock is shared by all instances of a ScopedConnectionList.
|
/* Even though our signals code is thread-safe, this additional list of
|
||||||
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
|
|
||||||
scoped connections needs to be protected in 2 cases:
|
scoped connections needs to be protected in 2 cases:
|
||||||
|
|
||||||
(1) (unlikely) we make a connection involving a callback on the
|
(1) (unlikely) we make a connection involving a callback on the
|
||||||
|
@ -146,7 +141,7 @@ class ScopedConnectionList : public boost::noncopyable
|
||||||
one from another.
|
one from another.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static Glib::StaticMutex _lock;
|
Glib::Mutex _lock;
|
||||||
|
|
||||||
typedef std::list<ScopedConnection*> ConnectionList;
|
typedef std::list<ScopedConnection*> ConnectionList;
|
||||||
ConnectionList _list;
|
ConnectionList _list;
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
|
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
Glib::StaticMutex ScopedConnectionList::_lock = GLIBMM_STATIC_MUTEX_INIT;
|
|
||||||
|
|
||||||
ScopedConnectionList::ScopedConnectionList()
|
ScopedConnectionList::ScopedConnectionList()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user