From 3d1eb9a6e5250bfc2f4d0138c004a82d6186beab Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 19 Dec 2016 14:35:29 +0000 Subject: [PATCH] Session::auto_connect_thread_terminate() cannot use ::auto_connect_thread_wakeup() because that method is allowed to "fail". Should fix hangs when closing a session with the ALSA backend (and perhaps others too). --- libs/ardour/session.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 33cd651dcc..b9d78494a3 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -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);