BDE 4.14.0 Production release
|
#include <bslmt_qlock.h>
Public Member Functions | |
QLock_EventFlag () | |
Create an unset flag. | |
~QLock_EventFlag () | |
void | reset () |
void | set () |
void | waitUntilSet (int spinRetryCount) |
[PRIVATE] This class provides a thread-safe mechanism for one thread to inform another thread that some event has occurred. A flag provides two primary manipulators, set
, which indicates the event has occurred, and waitUntilSet
, which waits until that event has occurred (or returns immediately if it has already occurred). A flag is intended to be used by only two threads: a thread setting the flag, and a thread waiting for the flag to be set, and the behavior is undefined if set
is called while the flag is already set, or if waitUntilSet
is called while another thread is waiting for the flag.
This class is an implementation detail of the bslmt_qlock , and must not be used by client code.
See bslmt_qlock
|
inline |
|
inline |
Destroy this flag. The behavior is undefined if a thread is currently waiting for the flag to be set.
|
inline |
Reset this flag to the unset state. The behavior is undefined if a thread is waiting for this flag to be set.
void bslmt::QLock_EventFlag::set | ( | ) |
Set this flag, and if a thread is waiting for it, signal the waiting thread. The behavior is undefined if this flag is already set.
void bslmt::QLock_EventFlag::waitUntilSet | ( | int | spinRetryCount | ) |
Wait until this flag has been set (returning immediately if this flag is already set), and, if this flag is not already set, spin for the specified spinCount
iterations before waiting on a semaphore. The behavior is undefined unless there are no other threads waiting for this flag to be set.