2#ifndef POSIX_POSIXEVENT_H
3#define POSIX_POSIXEVENT_H
66 this->
manual = ev.semaphore;
67 ev.semaphore =
nullptr;
118 while (timeoutInMilliSec > 0)
125 timeoutInMilliSec -= 1;
137 return 0 == sem_trywait(this->
semaphore);
Posix implmentation of an event synchronization object.
Definition posixevent.h:20
void Signal()
signal the event
Definition posixevent.h:85
void Wait() const
wait for the event to become signalled
Definition posixevent.h:103
bool WaitTimeout(int ms) const
wait for the event with timeout in millisecs
Definition posixevent.h:116
bool IsManual() const
Returns true if event is manually reset.
Definition posixevent.h:144
bool manual
Definition posixevent.h:42
bool Peek() const
check if event is signalled
Definition posixevent.h:135
PosixEvent(bool manualReset=false)
constructor
Definition posixevent.h:51
sem_t * semaphore
Definition posixevent.h:43
void Reset()
reset the event (only if manual reset)
Definition posixevent.h:94
~PosixEvent()
destructor
Definition posixevent.h:74
Posix implemention of a read-many write-few lock.
Definition posixsysfunc.cc:21
A semaphore is an inter-GPU queue synchronization primitive.