[#BloombergLP-bslmt-QLock_EventFlag]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::QLock&lowbar;EventFlag
:relfileprefix: ../../
:mrdocs:

&lsqb;*PRIVATE*&rsqb;Thread&hyphen;safe flag for signaling an event between two threads&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;qlock&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class QLock&lowbar;EventFlag;
----

== Description

This class provides a thread&hyphen;safe mechanism for one thread to inform another thread that some event has occurred&period; 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)&period; A flag is intended to be used by only two threads&colon; 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&period;

This class is an implementation detail of the `bslmt&lowbar;qlock`, and must not be used by client code&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/QLock_EventFlag/2constructor.adoc[`QLock&lowbar;EventFlag`]         [.small]#[constructor]#
| Create an unset flag&period;
| xref:BloombergLP/bslmt/QLock_EventFlag/2destructor.adoc[`&#126;QLock&lowbar;EventFlag`] [.small]#[destructor]#
| Destroy this flag&period; The behavior is undefined if a thread is currently waiting for the flag to be set&period;
| xref:BloombergLP/bslmt/QLock_EventFlag/reset.adoc[`reset`] 
| Reset this flag to the unset state&period; The behavior is undefined if a thread is waiting for this flag to be set&period;
| xref:BloombergLP/bslmt/QLock_EventFlag/set.adoc[`set`] 
| Set this flag, and if a thread is waiting for it, signal the waiting thread&period; The behavior is undefined if this flag is already set&period;
| xref:BloombergLP/bslmt/QLock_EventFlag/waitUntilSet.adoc[`waitUntilSet`] 
| Wait until this flag is set, optionally spinning first&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
