[#BloombergLP-bslmt-QLock_EventFlag] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::QLock_EventFlag :relfileprefix: ../../ :mrdocs: [*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. == Synopsis Declared in `<bslmt_qlock.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class QLock_EventFlag; ---- == Description This class is an implementation detail of the `bslmt_qlock`, and must not be used by client code. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/QLock_EventFlag/2constructor.adoc[`QLock_EventFlag`] [.small]#[constructor]# | Create an unset flag. | xref:BloombergLP/bslmt/QLock_EventFlag/2destructor.adoc[`~QLock_EventFlag`] [.small]#[destructor]# | Destroy this flag. The behavior is undefined if a thread is currently waiting for the flag to be set. | xref:BloombergLP/bslmt/QLock_EventFlag/reset.adoc[`reset`] | Reset this flag to the unset state. The behavior is undefined if a thread is waiting for this flag to be set. | xref:BloombergLP/bslmt/QLock_EventFlag/set.adoc[`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. | xref:BloombergLP/bslmt/QLock_EventFlag/waitUntilSet.adoc[`waitUntilSet`] | 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#