#include <thread.h>
Inheritance diagram for ucommon::Conditional:
Static Public Member Functions | |
static pthread_condattr_t * | initializer (void) |
Support function for getting conditional attributes for realtime scheduling. | |
static void | set (struct timespec *hires, timeout_t timeout) |
Convert a millisecond timeout into use for high resolution conditional timers. | |
Protected Member Functions | |
void | broadcast (void) |
Signal the conditional to release all waiting threads. | |
Conditional () | |
Initialize and construct conditional. | |
void | lock (void) |
Lock the conditional's supporting mutex. | |
void | signal (void) |
Signal the conditional to release one waiting thread. | |
void | unlock (void) |
Unlock the conditional's supporting mutex. | |
void | wait (void) |
Wait (block) until signalled. | |
bool | wait (struct timespec *timeout) |
Conditional wait for signal on timespec timeout. | |
bool | wait (timeout_t timeout) |
Conditional wait for signal on millisecond timeout. | |
~Conditional () | |
Destroy conditional, release any blocked threads. | |
Friends | |
class | ConditionalAccess |
class | TimedEvent |
Many of the complex sychronization objects, including barriers, semaphores, and various forms of read/write locks are all built from the conditional. This assures that the minimum functionality to build higher order thread synchronizing objects is a pure conditional, and removes dependencies on what may be optional features or functions that may have different behaviors on different pthread implimentations and platforms.
Definition at line 86 of file thread.h.
static pthread_condattr_t* ucommon::Conditional::initializer | ( | void | ) | [inline, static] |
static void ucommon::Conditional::set | ( | struct timespec * | hires, | |
timeout_t | timeout | |||
) | [static] |
Convert a millisecond timeout into use for high resolution conditional timers.
hires | timespec representation to set. | |
timeout | to convert. |
Reimplemented in ucommon::ConditionalAccess.
bool ucommon::Conditional::wait | ( | struct timespec * | timeout | ) | [protected] |
Conditional wait for signal on timespec timeout.
timeout | as a high resolution timespec. |
bool ucommon::Conditional::wait | ( | timeout_t | timeout | ) | [protected] |
Conditional wait for signal on millisecond timeout.
timeout | in milliseconds. |
Reimplemented in ucommon::barrier, and ucommon::Semaphore.