Create a guard that manages and acquires the specified lock.

Synopsis

Declared in <bsls_bsllock.h>

explicit
BslLockGuard(BslLock* lock);

Description

Create a guard object that conditionally manages the specified lock, and acquires the lock on lock by invoking its lock method. The behavior is undefined unless the calling thread does not already hold the lock on lock. Note that deadlock may result if a guard is created for lock while the calling thread holds the lock on lock. Also note that lock must remain valid throughout the lifetime of this guard, or until release is called.

Parameters

Name

Description

lock

mutex to manage and lock

Created with MrDocs