Session::auto_connect_thread_terminate() cannot use ::auto_connect_thread_wakeup...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 19 Dec 2016 14:35:29 +0000 (14:35 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 19 Dec 2016 14:36:39 +0000 (14:36 +0000)
Should fix hangs when closing a session with the ALSA backend (and perhaps others too).

libs/ardour/session.cc

index 33cd651dcc3f3c1899efc6ca037170d0921b7261..b9d78494a3fefdd38d2365d3576d8d6d8ed0b521 100644 (file)
@@ -7024,7 +7024,13 @@ Session::auto_connect_thread_terminate ()
                }
        }
 
-       auto_connect_thread_wakeup ();
+       /* cannot use auto_connect_thread_wakeup() because that is allowed to
+        * fail to wakeup the thread.
+        */
+
+       pthread_mutex_lock (&_auto_connect_mutex);
+       pthread_cond_signal (&_auto_connect_cond);
+       pthread_mutex_unlock (&_auto_connect_mutex);
 
        void *status;
        pthread_join (_auto_connect_thread, &status);