BloombergLP::bslmt::FastPostSemaphore::getDisabledState

Return an odd value if this semaphore is wait disabled, and an even value otherwise. 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. For example, for any initial state of a semaphore instance obj: ` int state = obj.getDisabledState(); obj.disable(); obj.enable(); ASSERT(state != obj.getDisabledState()); ` This functionality is useful in higher-level components to determine if this semaphore was disabled during an operation.

Synopsis

Declared in <bslmt_fastpostsemaphore.h>

int
getDisabledState() const;