diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-01 20:55:39 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-01 20:55:39 +0100 |
commit | 9a30bfd0c602ee08142374b2a409d28573530fc6 (patch) | |
tree | 656fa6b50179819f1d93f5092500a331ad54f194 /libs/ardour/ardour/butler.h | |
parent | d7727a77e0b19ecb2d1957d1e13d554dbed58243 (diff) |
use Xthreads in session butler.
(hopefully) fixes export randomly stalling on windows:
dequeue_request() was a single request (no queue) on Windows.
Butler::queue_request() is called
-> Butler goes to work..
-> while working, another request is queued
-> butler never sees this
-> deadlock
during Freewheeling/Export wait_until_finished()
waits for the 2nd request to be handled, and never returns.
Diffstat (limited to 'libs/ardour/ardour/butler.h')
-rw-r--r-- | libs/ardour/ardour/butler.h | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/libs/ardour/ardour/butler.h b/libs/ardour/ardour/butler.h index 949668dab3..94b6fb876b 100644 --- a/libs/ardour/ardour/butler.h +++ b/libs/ardour/ardour/butler.h @@ -28,6 +28,7 @@ #include "pbd/glib_semaphore.h" #endif +#include "pbd/crossthread.h" #include "pbd/ringbuffer.h" #include "pbd/pool.h" #include "ardour/libardour_visibility.h" @@ -86,38 +87,17 @@ class LIBARDOUR_API Butler : public SessionHandleRef uint32_t midi_dstream_buffer_size; RingBuffer<CrossThreadPool*> pool_trash; -#ifdef PLATFORM_WINDOWS - PBD::atomic_counter m_request_state; - PBD::GlibSemaphore m_request_sem; -#else - int request_pipe[2]; -#endif - private: void empty_pool_trash (); void config_changed (std::string); -#ifndef PLATFORM_WINDOWS - int setup_request_pipe (); -#endif - - /** - * return true if there are requests to be processed - */ - bool wait_for_requests (); - - /** - * Remove request from butler request queue - * - * return true if there was another request and req is valid - */ - bool dequeue_request (Request::Type& req); - /** * Add request to butler thread request queue */ void queue_request (Request::Type r); + CrossThreadChannel _xthread; + }; } // namespace ARDOUR |