BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslmt::QLock_EventFlag Class Reference

#include <bslmt_qlock.h>

Public Member Functions

 QLock_EventFlag ()
 Create an unset flag.
 
 ~QLock_EventFlag ()
 
void reset ()
 
void set ()
 
void waitUntilSet (int spinRetryCount)
 

Detailed Description

[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

Constructor & Destructor Documentation

◆ QLock_EventFlag()

bslmt::QLock_EventFlag::QLock_EventFlag ( )
inline

◆ ~QLock_EventFlag()

bslmt::QLock_EventFlag::~QLock_EventFlag ( )
inline

Destroy this flag. The behavior is undefined if a thread is currently waiting for the flag to be set.

Member Function Documentation

◆ reset()

void bslmt::QLock_EventFlag::reset ( )
inline

Reset this flag to the unset state. The behavior is undefined if a thread is waiting for this flag to be set.

◆ 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.

◆ waitUntilSet()

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.


The documentation for this class was generated from the following file: