diff options
author | Carl Hetherington <carl@carlh.net> | 2012-05-15 00:06:06 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-05-15 00:06:06 +0000 |
commit | 32bed9aaf040cbd06f9855b568c14cb7a7050d58 (patch) | |
tree | 6fb1132ec8cc90491cb55a35dc165047e9bc5cc8 /libs | |
parent | 14a86aaccc8eadb2f2c8dc5f7251fb1f9c602f30 (diff) |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/pbd/pbd/signals.h | 9 | ||||
-rw-r--r-- | libs/pbd/signals.cc | 2 |
2 files changed, 2 insertions, 9 deletions
diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h index e40b0bd2a4..904d51e45f 100644 --- a/libs/pbd/pbd/signals.h +++ b/libs/pbd/pbd/signals.h @@ -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; diff --git a/libs/pbd/signals.cc b/libs/pbd/signals.cc index 467ef02a12..cafb98f6bf 100644 --- a/libs/pbd/signals.cc +++ b/libs/pbd/signals.cc @@ -22,8 +22,6 @@ using namespace PBD; -Glib::StaticMutex ScopedConnectionList::_lock = GLIBMM_STATIC_MUTEX_INIT; - ScopedConnectionList::ScopedConnectionList() { } |