diff options
author | David Robillard <d@drobilla.net> | 2013-01-11 03:35:17 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-11 03:35:17 +0000 |
commit | a90eec5c87af4dec9f8f45223cd228cb7ca674c6 (patch) | |
tree | 5363986923fc4ed2d025a975d0f890df9733269a /src/server/PreProcessor.hpp | |
parent | 8caefa2c374ecf3af9ea455ce24784d398254ddf (diff) | |
download | ingen-a90eec5c87af4dec9f8f45223cd228cb7ca674c6.tar.gz ingen-a90eec5c87af4dec9f8f45223cd228cb7ca674c6.tar.bz2 ingen-a90eec5c87af4dec9f8f45223cd228cb7ca674c6.zip |
Use C++11 atomics.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4916 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PreProcessor.hpp')
-rw-r--r-- | src/server/PreProcessor.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/PreProcessor.hpp b/src/server/PreProcessor.hpp index 9b7fbd44..10563ee9 100644 --- a/src/server/PreProcessor.hpp +++ b/src/server/PreProcessor.hpp @@ -17,9 +17,10 @@ #ifndef INGEN_ENGINE_PREPROCESSOR_HPP #define INGEN_ENGINE_PREPROCESSOR_HPP +#include <atomic> + #include <glibmm/thread.h> -#include "raul/AtomicPtr.hpp" #include "raul/Semaphore.hpp" #include "raul/Thread.hpp" @@ -43,7 +44,7 @@ public: } /** Return true iff no events are enqueued. */ - inline bool empty() const { return !_head.get(); } + inline bool empty() const { return !_head.load(); } /** Enqueue an event. * This is safe to call from any non-realtime thread (it locks). @@ -61,11 +62,11 @@ protected: virtual void _run(); private: - Glib::Mutex _mutex; - Raul::Semaphore _sem; - Raul::AtomicPtr<Event> _head; - Raul::AtomicPtr<Event> _prepared_back; - Raul::AtomicPtr<Event> _tail; + Glib::Mutex _mutex; + Raul::Semaphore _sem; + std::atomic<Event*> _head; + std::atomic<Event*> _prepared_back; + std::atomic<Event*> _tail; }; } // namespace Server |