#include <mt_posix.h>
Public Member Functions | |
Event (bool bAutoReset=true, bool initState=false) | |
Creates the mutex. | |
Event (bool bAutoReset=true, bool initState=false) | |
Creates the mutex. | |
void | reset () |
Resets the event. | |
void | reset () |
Resets the event. | |
void | set () |
Signals the event. | |
void | set () |
Signals the event. | |
bool | wait (int32 to=-1) |
Waits on the given event. | |
bool | wait (int32 to=-1) |
Waits on the given event. | |
~Event () | |
Destroys the event. | |
~Event () | |
Destroys the event. |
Directly mapping to the underlying type via inline functions.
Well, events are definitely not the best way to handle MT things, the mutex / POSIX cv / predicate is definitely better (faster, more flexible, safer etc), but we're using a set of definite MT patterns in which using MS-WIN style events doesn't make a great difference.
For low level business (i.e. implementing the script-level Waitable system) we're still using the system specific features (multiple wait on MS-WIN, condvars on POSIX). This is class is used as a middle-level equalizer in simple MT tasks as i.e. signaling non-empty queues or generic work-to-be-done flags.
Falcon::Event::Event | ( | bool | bAutoReset = true , |
|
bool | initState = false | |||
) | [inline] |
Falcon::Event::~Event | ( | ) | [inline] |
Falcon::Event::Event | ( | bool | bAutoReset = true , |
|
bool | initState = false | |||
) | [inline] |
Creates the mutex.
Will assert on failure.
Falcon::Event::~Event | ( | ) | [inline] |
Destroys the event.
Will assert on failure.
void Falcon::Event::reset | ( | ) | [inline] |
Resets the event.
Useful only if the event is not auto-reset.
void Falcon::Event::reset | ( | ) | [inline] |
void Falcon::Event::set | ( | ) | [inline] |
Signals the event.
Will assert on failure -- but only in debug
void Falcon::Event::set | ( | ) |
Signals the event.
Will assert on failure -- but only in debug
bool Falcon::Event::wait | ( | int32 | to = -1 |
) | [inline] |
Waits on the given event.
The wait is not interruptible. If a thread is blocked on this wait, the event must be signaled somewhere else to allow it to proceed and check for closure request.
Falcon script level have better semantics, but this object is meant for fairly basic and low-level system related activites.
If the event is auto-reset, only one waiting thread is woken up, and after the wakeup the event is automatically reset.
to | The timeout; set to < 0 for infinite timeout, 0 to check without blocking and > 0 for a number of MSecs wait. |
bool Falcon::Event::wait | ( | int32 | to = -1 |
) |
Waits on the given event.
The wait is not interruptible. If a thread is blocked on this wait, the event must be signaled somewhere else to allow it to proceed and check for closure request.
Falcon script level have better semantics, but this object is meant for fairly basic and low-level system related activites.
If the event is auto-reset, only one waiting thread is woken up, and after the wakeup the event is automatically reset.
to | The timeout; set to < 0 for infinite timeout, 0 to check without blocking and > 0 for a number of MSecs wait. |