BloombergLP::bslmt::QLockGuard::QLockGuard

Create a guard associated with the specified qlock.

Synopsis

Declared in <bslmt_qlock.h>

explicit
QLockGuard(
    QLock* qlock,
    bool doLock = true);

Description

Create a guard associated with the specified qlock. Acquire the lock unless the (optionally) specified doLock is false. If the lock is not free, block until it can be acquired.

Parameters

NameDescription
qlockQLock with which to associate this guard
doLockif true (the default), acquire the lock on construction