MPQC 2.3.1
sc::ThreadLockHolder Class Reference

Acquire a lock on creation and release it on destruction. More...

#include <thread.h>

Public Member Functions

 ThreadLockHolder (const Ref< ThreadLock > &l)
 Acquires the lock.
void unlock ()
 Release the lock before the DTOR is called, if it is still held.
void lock ()
 Acquire the lock once more.
 ~ThreadLockHolder ()
 Releases the lock if it is still held.

Detailed Description

Acquire a lock on creation and release it on destruction.

This should be used to lock and unlock ThreadLock objects to provide exception safety.

Constructor & Destructor Documentation

◆ ~ThreadLockHolder()

sc::ThreadLockHolder::~ThreadLockHolder ( )
inline

Releases the lock if it is still held.

References unlock().

Member Function Documentation

◆ unlock()

void sc::ThreadLockHolder::unlock ( )
inline

Release the lock before the DTOR is called, if it is still held.

Referenced by ~ThreadLockHolder().


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

Generated at for MPQC 2.3.1 using the documentation package Doxygen 1.18.0.