From 32bed9aaf040cbd06f9855b568c14cb7a7050d58 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 15 May 2012 00:06:06 +0000 Subject: [PATCH] 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 --- libs/pbd/pbd/signals.h | 9 ++------- 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 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() { }