summaryrefslogtreecommitdiffstats
path: root/src/server/PreProcessor.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-04 00:54:25 +0000
committerDavid Robillard <d@drobilla.net>2013-02-04 00:54:25 +0000
commit46c3a486eee4b2ef69d9cc4f9e2701082c64d7c8 (patch)
treeecf7a89fb1c28a619106dd78ccd257a1ff52c70a /src/server/PreProcessor.hpp
parent69f98d63f5bd22c82208fef5fbc2a61613541bd7 (diff)
downloadingen-46c3a486eee4b2ef69d9cc4f9e2701082c64d7c8.tar.gz
ingen-46c3a486eee4b2ef69d9cc4f9e2701082c64d7c8.tar.bz2
ingen-46c3a486eee4b2ef69d9cc4f9e2701082c64d7c8.zip
Replace Raul::thread with std::thread.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5047 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PreProcessor.hpp')
-rw-r--r--src/server/PreProcessor.hpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/server/PreProcessor.hpp b/src/server/PreProcessor.hpp
index 10563ee9..d8e71428 100644
--- a/src/server/PreProcessor.hpp
+++ b/src/server/PreProcessor.hpp
@@ -18,11 +18,10 @@
#define INGEN_ENGINE_PREPROCESSOR_HPP
#include <atomic>
-
-#include <glibmm/thread.h>
+#include <thread>
+#include <mutex>
#include "raul/Semaphore.hpp"
-#include "raul/Thread.hpp"
namespace Ingen {
namespace Server {
@@ -31,18 +30,13 @@ class Event;
class PostProcessor;
class ProcessContext;
-class PreProcessor : public Raul::Thread
+class PreProcessor
{
public:
explicit PreProcessor();
~PreProcessor();
- virtual void join() {
- _exit_flag = true;
- _sem.post();
- }
-
/** Return true iff no events are enqueued. */
inline bool empty() const { return !_head.load(); }
@@ -59,14 +53,16 @@ public:
bool limit = true);
protected:
- virtual void _run();
+ void run();
private:
- Glib::Mutex _mutex;
+ std::mutex _mutex;
Raul::Semaphore _sem;
std::atomic<Event*> _head;
std::atomic<Event*> _prepared_back;
std::atomic<Event*> _tail;
+ bool _exit_flag;
+ std::thread _thread;
};
} // namespace Server