[#BloombergLP-bslmt-FastPostSemaphoreImpl-tryWait] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/FastPostSemaphoreImpl.adoc[FastPostSemaphoreImpl]::tryWait :relfileprefix: ../../../ :mrdocs: Attempt to acquire a resource without blocking. == Synopsis Declared in `<bslmt_fastpostsemaphoreimpl.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int tryWait(); ---- == Description If this semaphore is initially disabled, return `e_DISABLED` with no effect on the count. Otherwise, if the count of this semaphore is a positive value, return 0 and atomically decrement the count. If this semaphore is not disabled and the count of this semaphore is not a positive value, return `e_WOULD_BLOCK` with no effect on the count. == Return Value 0 on success, `e_DISABLED` if disabled, or `e_WOULD_BLOCK` if the count is not positive [.small]#Created with https://www.mrdocs.com[MrDocs]#