Return an odd value if this semaphore is wait disabled, and an even value otherwise.

Synopsis

Declared in <bslmt_fastpostsemaphoreimpl.h>

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. For example, for any initial state of a semphore 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.

Return Value

odd value if wait disabled, and an even value otherwise

Created with MrDocs