[#BloombergLP-bslmt-Condition]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::Condition
:relfileprefix: ../../
:mrdocs:

This `class` implements a portable inter&hyphen;thread signaling primitive&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Condition;
----

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/Condition/_04enum.adoc[`Unnamed enum`] 
| The value `timedWait` returns when a timeout occurs&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/Condition/2constructor-0b8.adoc[`Condition`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslmt/Condition/2destructor.adoc[`&#126;Condition`] [.small]#[destructor]#
| Destroy this condition variable object&period;
| xref:BloombergLP/bslmt/Condition/broadcast.adoc[`broadcast`] 
| Signal this condition variable object by waking up _all_ threads that are currently waiting on this condition&period; If there are no threads waiting on this condition, this method has no effect&period;
| xref:BloombergLP/bslmt/Condition/clockType.adoc[`clockType`] 
| Return the clock type used for timeouts&period;
| xref:BloombergLP/bslmt/Condition/signal.adoc[`signal`] 
| Signal this condition variable object by waking up a single thread that is currently waiting on this condition&period; If there are no threads waiting on this condition, this method has no effect&period;
| xref:BloombergLP/bslmt/Condition/timedWait-00.adoc[`timedWait`] 
| `timedWait` overloads
| xref:BloombergLP/bslmt/Condition/wait.adoc[`wait`] 
| Atomically unlock the specified `mutex` and suspend execution of the current thread until this condition object is &quot;signaled&quot; (i&period;e&period;, either `signal` or `broadcast` is invoked on this object in another thread), then re&hyphen;acquire a lock on the `mutex`&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; Spurious wakeups are rare but possible&semi; i&period;e&period;, this method may succeed (return 0), and return control to the thread without the condition object being signaled&period; The behavior is undefined unless `mutex` is locked by the calling thread prior to calling this method&period; Note that `mutex` remains locked by the calling thread upon return from this function&period;
|===



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