add AudioBackendNativeThread to serve the same role as jack_native_thread_t
[ardour.git] / libs / ardour / graph.cc
index cb0fa1b21ae28b8d45ea3aaab7af32f522f525d0..c8e374cddc9d4a4eab7bcb0baac3bd0264dd270b 100644 (file)
@@ -101,7 +101,7 @@ Graph::reset_thread_list ()
         }
 
         Glib::Threads::Mutex::Lock lm (_session.engine().process_lock());
-       pthread_t a_thread;
+       AudioBackendNativeThread a_thread;
 
         if (!_thread_list.empty()) {
                 drop_threads ();
@@ -146,9 +146,8 @@ Graph::drop_threads ()
 
         _callback_start_sem.signal ();
 
-        for (list<pthread_t>::iterator i = _thread_list.begin(); i != _thread_list.end(); ++i) {
-                void* status;
-                pthread_join (*i, &status);
+        for (list<AudioBackendNativeThread>::iterator i = _thread_list.begin(); i != _thread_list.end(); ++i) {
+               AudioEngine::instance()->wait_for_process_thread_exit (*i);
         }
 
         _thread_list.clear ();
@@ -584,8 +583,8 @@ Graph::process_one_route (Route* route)
 bool
 Graph::in_process_thread () const
 {
-       for (list<pthread_t>::const_iterator i = _thread_list.begin (); i != _thread_list.end(); ++i) {
-               if (*i == pthread_self()) {
+       for (list<AudioBackendNativeThread>::const_iterator i = _thread_list.begin (); i != _thread_list.end(); ++i) {
+               if (self_thread_equal (*i)) {
                        return true;
                }
        }