From 9a30bfd0c602ee08142374b2a409d28573530fc6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 1 Mar 2015 20:55:39 +0100 Subject: 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. --- libs/ardour/ardour/butler.h | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'libs/ardour/ardour/butler.h') 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 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 -- cgit v1.2.3