BloombergLP::bslmt::RWMutexImpl<Platform::PosixThreads>::tryLockWrite

Attempt to lock this readers-writer mutex for writing.

Synopsis

Declared in <bslmt_rwmutex.h>

int
tryLockWrite();

Description

Immediately return 0 on success, and a non-zero value if there are active or pending locks on this mutex. If successful, unlock must be used to release the lock on this mutex. The behavior is undefined if this method is called from a thread that already has a lock on this mutex.

Return Value

0 on success, and a non-zero value if there are active or pending locks on this mutex