[#BloombergLP-bslmt-Semaphore-tryWait] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/Semaphore.adoc[Semaphore]::tryWait :relfileprefix: ../../../ :mrdocs: If the count of this semaphore is positive, atomically decrement the count and return 0; otherwise, return a non‐zero value with no effect on the count. == Synopsis Declared in `<bslmt_semaphore.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int tryWait(); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#