46 while (
data.size() > 0) {
47 auto element =
data.front();
75 auto element =
data.front();
Threading condition variable implementation.
void broadcast()
wake ups all waiting threads on this condition, associated mutex should protect broadcast
void signal()
wake ups a waiting thread on this condition, associated mutex should protect signal
void wait(Mutex &mutex)
Blocks current thread until signaled/broadcasted, associated mutex should protect wait.
void unlock()
Unlocks this mutex.
void lock()
Locks the mutex, additionally mutex locks will block until other locks have been unlocked.
T * getElement()
Gets an element from this queue, if no element exists yet the calling thread will be blocked until an...
bool addElement(T *element, const bool declinable)
Adds an element to this queue, signals threads which waits for an element.
volatile bool stopRequested
void stop()
Requests this queue to be stopped, any gets will be woke up and return NULL.
virtual ~Queue()
Destructor, removes remaining elements from queue.
#define FORBID_CLASS_COPY(CLASS)