BloombergLP::bslmt::RecursiveMutex::tryLock

Attempt to acquire a lock on this mutex without blocking.

Synopsis

Declared in <bslmt_recursivemutex.h>

int
tryLock();

Description

Attempt to acquire a lock on this object. Return 0 on success, and a non-zero value if this object is already locked by another thread, or if an error occurs. Succeed immediately if this thread already holds the lock.

Return Value

0 on success, and a non-zero value if already locked or on error