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

Return an odd value if this semaphore is wait disabled, and an even value otherwise&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
getDisabledState() const;
----

== Description

The returned value can be used to detect a rapid short sequence of `disable` and `enable` invocations by comparing the value returned by `getDisabledState` before and after the sequence&period; For example, for any initial state of a semaphore instance `obj`&colon; &grave; int state &equals; obj&period;getDisabledState()&semi; obj&period;disable()&semi; obj&period;enable()&semi; ASSERT(state !&equals; obj&period;getDisabledState())&semi; &grave; This functionality is useful in higher&hyphen;level components to determine if this semaphore was disabled during an operation&period;

== Return Value

odd value if wait disabled, and even value otherwise


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