diff options
author | David Robillard <d@drobilla.net> | 2007-01-22 04:07:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-01-22 04:07:53 +0000 |
commit | 6fc1fa0d3bec4b82cb3af4c4e887241087899e7e (patch) | |
tree | 642326c791c1cac6390b8cc10f6b5fac52e0f36e /src/libs/engine/QueuedEventSource.h | |
parent | 6a03dfaf79aa0713df17b03880aaedb3fa8984eb (diff) | |
download | ingen-6fc1fa0d3bec4b82cb3af4c4e887241087899e7e.tar.gz ingen-6fc1fa0d3bec4b82cb3af4c4e887241087899e7e.tar.bz2 ingen-6fc1fa0d3bec4b82cb3af4c4e887241087899e7e.zip |
Added atomic int/pointer classes to Raul.
Added multi-writer queue to Raul.
Renamed Queue SRSWQueue (single-reader single-writer).
Updated patchage/ingen for Raul changes.
git-svn-id: http://svn.drobilla.net/lad/ingen@264 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/QueuedEventSource.h')
-rw-r--r-- | src/libs/engine/QueuedEventSource.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libs/engine/QueuedEventSource.h b/src/libs/engine/QueuedEventSource.h index db003a92..077cf7f2 100644 --- a/src/libs/engine/QueuedEventSource.h +++ b/src/libs/engine/QueuedEventSource.h @@ -21,7 +21,7 @@ #include <pthread.h> #include "types.h" #include "raul/Semaphore.h" -#include "raul/Queue.h" +#include "raul/SRSWQueue.h" #include "raul/Slave.h" #include "Event.h" #include "EventSource.h" @@ -80,7 +80,7 @@ private: Semaphore _blocking_semaphore; /** Queue for timestamped events (no pre-processing). */ - Queue<Event*> _stamped_queue; + SRSWQueue<Event*> _stamped_queue; }; @@ -93,9 +93,14 @@ private: inline Event* QueuedEventSource::pop_earliest_stamped_before(const SampleCount time) { - if (!_stamped_queue.is_empty() && _stamped_queue.front()->time() < time) - return _stamped_queue.pop(); - return NULL; + Event* ret = NULL; + + if (!_stamped_queue.empty() && _stamped_queue.front()->time() < time) { + ret = _stamped_queue.front(); + _stamped_queue.pop(); + } + + return ret; } |