diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-12 14:43:24 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-12 14:43:24 +0000 |
commit | bc89fe0147c04b67141936d109c00dfd4d69cc4b (patch) | |
tree | 544ff450c40fe1f43853a8420228a26f27f1eafb /libs/pbd/pthread_utils.cc | |
parent | 30daaebaa2d90d6b0e8673143ccc3cacd7bd1753 (diff) |
most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas.cc; builds and runs and does a few specific things but expect it to be buggy for a while yet
git-svn-id: svn://localhost/ardour2/branches/3.0@4313 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pthread_utils.cc')
-rw-r--r-- | libs/pbd/pthread_utils.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index 3408f2c0b7..c63f988af3 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -30,14 +30,31 @@ using namespace std; typedef std::map<string,pthread_t> ThreadMap; static ThreadMap all_threads; static pthread_mutex_t thread_map_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t gui_notify_lock = PTHREAD_MUTEX_INITIALIZER; namespace PBD { - sigc::signal<void,pthread_t,std::string> ThreadCreated; + sigc::signal<void,pthread_t> ThreadLeaving; sigc::signal<void,pthread_t,std::string,uint32_t> ThreadCreatedWithRequestSize; } using namespace PBD; +void +PBD::notify_gui_about_thread_creation (pthread_t thread, std::string str, int request_count) +{ + pthread_mutex_lock (&gui_notify_lock); + ThreadCreatedWithRequestSize (thread, str, request_count); + pthread_mutex_unlock (&gui_notify_lock); +} + +void +PBD::notify_gui_about_thread_exit (pthread_t thread) +{ + pthread_mutex_lock (&gui_notify_lock); + ThreadLeaving (thread); + pthread_mutex_unlock (&gui_notify_lock); +} + int pthread_create_and_store (string name, pthread_t *thread, pthread_attr_t *attr, void * (*start_routine)(void *), void * arg) { |