summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/PostProcessor.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-07-12 06:34:30 +0000
committerDavid Robillard <d@drobilla.net>2006-07-12 06:34:30 +0000
commit7e013dc6986fa9d6dc8616d494d9de5d192c4c69 (patch)
tree89bc9d97375fafae33cf22f1020c788baa8d326c /src/libs/engine/PostProcessor.h
parent120757b8cb154266aae21472a49f0c00309a7dde (diff)
downloadingen-7e013dc6986fa9d6dc8616d494d9de5d192c4c69.tar.gz
ingen-7e013dc6986fa9d6dc8616d494d9de5d192c4c69.tar.bz2
ingen-7e013dc6986fa9d6dc8616d494d9de5d192c4c69.zip
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
Diffstat (limited to 'src/libs/engine/PostProcessor.h')
-rw-r--r--src/libs/engine/PostProcessor.h31
1 files changed, 6 insertions, 25 deletions
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<Event*> 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<Event*> _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