From 7e013dc6986fa9d6dc8616d494d9de5d192c4c69 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 12 Jul 2006 06:34:30 +0000 Subject: Factored out Thread (and Slave, an explicitly signal-driven thread) git-svn-id: http://svn.drobilla.net/lad/ingen@87 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/PostProcessor.h | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'src/libs/engine/PostProcessor.h') diff --git a/src/libs/engine/PostProcessor.h b/src/libs/engine/PostProcessor.h index 2083c442..e0c384eb 100644 --- a/src/libs/engine/PostProcessor.h +++ b/src/libs/engine/PostProcessor.h @@ -21,6 +21,7 @@ #include "types.h" #include "util/Queue.h" #include "util/Semaphore.h" +#include "Slave.h" namespace Om { @@ -35,44 +36,24 @@ class Event; * * \ingroup engine */ -class PostProcessor +class PostProcessor : public Slave { public: PostProcessor(size_t queue_size); - ~PostProcessor(); - void start(); - void stop(); - - inline void push(Event* const ev); - void signal(); + /** Push an event on to the process queue, realtime-safe, not thread-safe. */ + inline void push(Event* const ev) { _events.push(ev); } private: // Prevent copies PostProcessor(const PostProcessor&); PostProcessor& operator=(const PostProcessor&); - Queue m_events; - - static void* process_events(void* me); - void* m_process_events(); - - pthread_t m_process_thread; - bool m_thread_exists; - static bool m_process_thread_exit_flag; - Semaphore m_semaphore; + Queue _events; + virtual void _signalled(); }; -/** Push an event on to the process queue, realtime-safe, not thread-safe. - */ -inline void -PostProcessor::push(Event* const ev) -{ - m_events.push(ev); -} - - } // namespace Om #endif // POSTPROCESSOR_H -- cgit v1.2.1