The conditional rw seperates scheduling for optizming behavior or rw locks.
More...
#include <condition.h>
|
void | access (void) |
| Access mode shared thread scheduling.
|
|
void | commit (void) |
| Complete exclusive mode write scheduling.
|
|
| ConditionalAccess () |
| Initialize and construct conditional.
|
|
void | limit_sharing (unsigned max) |
| Specify a maximum sharing (access) limit.
|
|
void | modify (void) |
| Exclusive mode write thread scheduling.
|
|
void | release (void) |
| Release access mode read scheduling.
|
|
| ~ConditionalAccess () |
| Destroy conditional, release any blocked threads.
|
|
|
void | broadcast (void) |
| Signal the conditional to release all broadcast threads.
|
|
void | lock (void) |
| Lock the conditional's supporting mutex.
|
|
void | signal (void) |
| Signal the conditional to release one signalled thread.
|
|
void | unlock (void) |
| Unlock the conditional's supporting mutex.
|
|
bool | waitBroadcast (struct timespec *timeout) |
| Conditional wait for broadcast on timespec timeout.
|
|
bool | waitBroadcast (timeout_t timeout) |
| Conditional wait for broadcast on millisecond timeout.
|
|
void | waitBroadcast (void) |
| Wait (block) until broadcast.
|
|
bool | waitSignal (struct timespec *timeout) |
| Conditional wait for signal on timespec timeout.
|
|
bool | waitSignal (timeout_t timeout) |
| Conditional wait for signal on millisecond timeout.
|
|
void | waitSignal (void) |
| Wait (block) until signalled.
|
|
|
static void | set (struct timespec *hires, timeout_t timeout) |
| Convert a millisecond timeout into use for high resolution conditional timers.
|
|
The conditional rw seperates scheduling for optizming behavior or rw locks.
This varient of conditonal seperates scheduling read (broadcast wakeup) and write (signal wakeup) based threads. This is used to form generic rwlock's as well as the specialized condlock.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 337 of file condition.h.
◆ broadcast()
void ucommon::ConditionalAccess::broadcast |
( |
void | | ) |
|
|
inlineprotected |
Signal the conditional to release all broadcast threads.
Definition at line 454 of file condition.h.
◆ limit_sharing()
void ucommon::ConditionalAccess::limit_sharing |
( |
unsigned | max | ) |
|
Specify a maximum sharing (access) limit.
This can be used to detect locking errors, such as when aquiring locks that are not released.
- Parameters
-
◆ lock()
void ucommon::ConditionalAccess::lock |
( |
void | | ) |
|
|
inlineprotected |
Lock the conditional's supporting mutex.
Definition at line 418 of file condition.h.
◆ set()
static void ucommon::ConditionalAccess::set |
( |
struct timespec * | hires, |
|
|
timeout_t | timeout ) |
|
inlinestaticprotected |
Convert a millisecond timeout into use for high resolution conditional timers.
- Parameters
-
hires | timespec representation to set. |
timeout | to convert. |
Definition at line 388 of file condition.h.
◆ signal()
void ucommon::ConditionalAccess::signal |
( |
void | | ) |
|
|
inlineprotected |
Signal the conditional to release one signalled thread.
Definition at line 447 of file condition.h.
◆ unlock()
void ucommon::ConditionalAccess::unlock |
( |
void | | ) |
|
|
inlineprotected |
Unlock the conditional's supporting mutex.
Definition at line 425 of file condition.h.
◆ waitBroadcast() [1/3]
bool ucommon::ConditionalAccess::waitBroadcast |
( |
struct timespec * | timeout | ) |
|
|
protected |
Conditional wait for broadcast on timespec timeout.
- Parameters
-
timeout | as a high resolution timespec. |
- Returns
- true if signalled, false if timer expired.
◆ waitBroadcast() [2/3]
bool ucommon::ConditionalAccess::waitBroadcast |
( |
timeout_t | timeout | ) |
|
|
protected |
Conditional wait for broadcast on millisecond timeout.
- Parameters
-
- Returns
- true if signalled, false if timer expired.
◆ waitBroadcast() [3/3]
void ucommon::ConditionalAccess::waitBroadcast |
( |
void | | ) |
|
|
inlineprotected |
Wait (block) until broadcast.
Definition at line 439 of file condition.h.
◆ waitSignal() [1/3]
bool ucommon::ConditionalAccess::waitSignal |
( |
struct timespec * | timeout | ) |
|
|
protected |
Conditional wait for signal on timespec timeout.
- Parameters
-
timeout | as a high resolution timespec. |
- Returns
- true if signalled, false if timer expired.
◆ waitSignal() [2/3]
bool ucommon::ConditionalAccess::waitSignal |
( |
timeout_t | timeout | ) |
|
|
protected |
Conditional wait for signal on millisecond timeout.
- Parameters
-
- Returns
- true if signalled, false if timer expired.
◆ waitSignal() [3/3]
void ucommon::ConditionalAccess::waitSignal |
( |
void | | ) |
|
|
inlineprotected |
Wait (block) until signalled.
Definition at line 432 of file condition.h.
◆ bcast
pthread_cond_t ucommon::ConditionalAccess::bcast |
|
mutableprotected |
◆ max_sharing
unsigned ucommon::ConditionalAccess::max_sharing |
|
staticprotected |
◆ pending
unsigned ucommon::ConditionalAccess::pending |
|
protected |
◆ sharing
unsigned ucommon::ConditionalAccess::sharing |
|
protected |
◆ waiting
unsigned ucommon::ConditionalAccess::waiting |
|
protected |
The documentation for this class was generated from the following file:
- /builddir/build/BUILD/ucommon-7.0.0-build/ucommon-7.0.0/inc/ucommon/condition.h