BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsls::BslLock Class Reference

#include <bsls_bsllock.h>

Detailed Description

This class implements a light-weight, portable wrapper of an OS-level mutex to support intra-process synchronization. The mutex implemented by this class is non-recursive.

Note
Note that BslLock is not intended for direct use by client code; it is meant for internal use only.

See bsls_bsllock

Public Member Functions

 BslLock ()
 
 ~BslLock ()
 
void lock ()
 
void unlock ()
 

Constructor & Destructor Documentation

◆ BslLock()

bsls::BslLock::BslLock ( )
inline

Create a lock object initialized to the unlocked state.

◆ ~BslLock()

bsls::BslLock::~BslLock ( )
inline

Destroy this lock object.

Precondition
The behavior is undefined unless this object is in the unlocked state.

Member Function Documentation

◆ lock()

void bsls::BslLock::lock ( )
inline

Acquire the lock on this object. If the lock on this object is currently held by another thread, then suspend execution of the calling thread until the lock can be acquired.

Precondition
The behavior is undefined unless the calling thread does not already hold the lock on this object.
Note
Note that deadlock may result if this method is invoked while the calling thread holds the lock on the object.

◆ unlock()

void bsls::BslLock::unlock ( )
inline

Release the lock on this object that was previously acquired through a call to lock, enabling another thread to acquire the lock.

Precondition
The behavior is undefined unless the calling thread holds the lock on this object.

The documentation for this class was generated from the following file: