Semaphore.tryWait

bool tryWait()

If the current count is equal to zero, return. Otherwise, atomically decrement the count by one and return true.

Throws

SyncError on error.

Returns

true if the count was above zero and false if not.