diff options
author | Robin Gareus <robin@gareus.org> | 2015-12-02 16:03:28 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-12-02 16:03:28 +0100 |
commit | 003b632ed1dcc2a07514b23c5a1d992b49fa7baa (patch) | |
tree | 4ad80d7be91c4b0916bf4ab827d3b6e37b641342 /libs/ardour | |
parent | 4245f2a02b15ea787f3713fb5065fc5527788c44 (diff) |
consolidate semaphore implementation (part one)
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/worker.h | 4 | ||||
-rw-r--r-- | libs/ardour/worker.cc | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libs/ardour/ardour/worker.h b/libs/ardour/ardour/worker.h index c9ff2f2d7f..529d59a4a6 100644 --- a/libs/ardour/ardour/worker.h +++ b/libs/ardour/ardour/worker.h @@ -25,7 +25,7 @@ #include <glibmm/threads.h> #include "pbd/ringbuffer.h" -#include "pbd/semaphore.h" +#include "pbd/semutils.h" #include "ardour/libardour_visibility.h" @@ -92,7 +92,7 @@ private: RingBuffer<uint8_t>* _requests; RingBuffer<uint8_t>* _responses; uint8_t* _response; - PBD::Semaphore _sem; + PBD::ProcessSemaphore _sem; bool _exit; Glib::Threads::Thread* _thread; diff --git a/libs/ardour/worker.cc b/libs/ardour/worker.cc index aea1c6f8e3..ce71c92a15 100644 --- a/libs/ardour/worker.cc +++ b/libs/ardour/worker.cc @@ -32,7 +32,7 @@ Worker::Worker(Workee* workee, uint32_t ring_size) , _requests(new RingBuffer<uint8_t>(ring_size)) , _responses(new RingBuffer<uint8_t>(ring_size)) , _response((uint8_t*)malloc(ring_size)) - , _sem(0) + , _sem ("worker_semaphore", 0) , _exit(false) , _thread (Glib::Threads::Thread::create(sigc::mem_fun(*this, &Worker::run))) {} @@ -40,7 +40,7 @@ Worker::Worker(Workee* workee, uint32_t ring_size) Worker::~Worker() { _exit = true; - _sem.post(); + _sem.signal(); _thread->join(); } @@ -56,7 +56,7 @@ Worker::schedule(uint32_t size, const void* data) if (_requests->write((const uint8_t*)data, size) != size) { return false; } - _sem.post(); + _sem.signal(); return true; } |