Botan 1.10.17
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

◆ Mutex_Holder()

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.

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

◆ ~Mutex_Holder()

Botan::Mutex_Holder::~Mutex_Holder ( )
inline

Definition at line 64 of file mutex.h.

64{ mux->unlock(); }

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