diff options
author | Robin Gareus <robin@gareus.org> | 2017-05-07 02:02:30 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-05-07 02:02:30 +0200 |
commit | 6bcd543bf2cd3fab463253e39e10430016bd6504 (patch) | |
tree | 551c1a5fb22009ad1a8c32cc043d0b2e1ba834fa /libs/ardour/worker.cc | |
parent | e73755f8fb27c41a552acb4f8f6dedb6acbe8f32 (diff) |
Semaphores need to have a unique name -- fixes #7341
On Windows (and OSX) semaphores are named. If the name matches an existing
semaphore, it is re-used and not re-initialized. In case of multiple
LV2-plugins each with a worker-thread this can lead to a deadlock.
Diffstat (limited to 'libs/ardour/worker.cc')
-rw-r--r-- | libs/ardour/worker.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/ardour/worker.cc b/libs/ardour/worker.cc index 0a5971fa3e..66f833d087 100644 --- a/libs/ardour/worker.cc +++ b/libs/ardour/worker.cc @@ -22,6 +22,7 @@ #include "ardour/worker.h" #include "pbd/error.h" +#include "pbd/compose.h" #include <glibmm/timer.h> @@ -32,7 +33,7 @@ Worker::Worker(Workee* workee, uint32_t ring_size, bool threaded) , _requests(threaded ? new RingBuffer<uint8_t>(ring_size) : NULL) , _responses(new RingBuffer<uint8_t>(ring_size)) , _response((uint8_t*)malloc(ring_size)) - , _sem("worker_semaphore", 0) + , _sem(string_compose ("worker_semaphore%1", this).c_str(), 0) , _thread(NULL) , _exit(false) , _synchronous(!threaded) |