summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-08-11 20:21:44 +0200
committerRobin Gareus <robin@gareus.org>2015-08-11 20:22:20 +0200
commit2e38cb81fe0cb7afd492cf2d30d28f316c41b8e8 (patch)
tree09398c394789b68007231c648854da334809440d /libs/ardour/audioengine.cc
parent212a4c1f8d00a65e868f8a3baad1a7c48b795c67 (diff)
fix deadlock at exit on SMP systems
graph process-threads won't terminate properly while active.
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 16283d9232..00a381fcb5 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -863,10 +863,20 @@ AudioEngine::stop (bool for_latency)
return 0;
}
+ Glib::Threads::Mutex::Lock pl (_process_lock, Glib::Threads::NOT_LOCK);
+
+ if (running()) {
+ pl.acquire ();
+ }
+
if (_backend->stop ()) {
return -1;
}
-
+
+ if (pl.locked ()) {
+ pl.release ();
+ }
+
if (_session && _running &&
(_session->state_of_the_state() & Session::Loading) == 0 &&
(_session->state_of_the_state() & Session::Deletion) == 0) {