summaryrefslogtreecommitdiff
path: root/libs/pbd/pthread_utils.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-09 18:37:06 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-09 18:37:06 +0000
commitb8b55ef0036bbef9a2961f03f44387ea8c89456a (patch)
tree47bead791023bd5efab6306ebcfea101f48688a7 /libs/pbd/pthread_utils.cc
parentc38e02285fda1fd7966c9e4ad85994445247e6a6 (diff)
OSC is now driven by an event loop; fix up lifetime mgmt of Glib::Source to workaround bug in Glib
git-svn-id: svn://localhost/ardour2/branches/3.0@6329 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pthread_utils.cc')
-rw-r--r--libs/pbd/pthread_utils.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc
index 68082e6136..495214a481 100644
--- a/libs/pbd/pthread_utils.cc
+++ b/libs/pbd/pthread_utils.cc
@@ -124,6 +124,19 @@ pthread_kill_all (int signum)
}
void
+pthread_cancel_all ()
+{
+ pthread_mutex_lock (&thread_map_lock);
+ for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ++i) {
+ if (i->second != pthread_self()) {
+ pthread_cancel (i->second);
+ }
+ }
+ all_threads.clear();
+ pthread_mutex_unlock (&thread_map_lock);
+}
+
+void
pthread_cancel_one (pthread_t thread)
{
pthread_mutex_lock (&thread_map_lock);