Botan  1.10.9
Public Member Functions | List of all members
Botan::Mutex_Holder Class Reference

#include <mutex.h>

Public Member Functions

 Mutex_Holder (Mutex *m)
 
 ~Mutex_Holder ()
 

Detailed Description

Mutex Holding Class for RAII

Definition at line 50 of file mutex.h.

Constructor & Destructor Documentation

Botan::Mutex_Holder::Mutex_Holder ( Mutex m)
inline

Hold onto a mutex until we leave scope

Parameters
mthe mutex to lock

Definition at line 57 of file mutex.h.

References Botan::Mutex::lock().

57  : mux(m)
58  {
59  if(!mux)
60  throw Invalid_Argument("Mutex_Holder: Argument was NULL");
61  mux->lock();
62  }
virtual void lock()=0
std::invalid_argument Invalid_Argument
Definition: exceptn.h:20
Botan::Mutex_Holder::~Mutex_Holder ( )
inline

Definition at line 64 of file mutex.h.

References Botan::Mutex::unlock().

64 { mux->unlock(); }
virtual void unlock()=0

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