Botan: Botan::Mutex_Holder Class Reference

Botan 1.10.17

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

## ◆ Mutex_Holder()

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

Hold onto a mutex until we leave scope

Parameters

  m | the 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 }
Botan::Mutex::lock
virtual void lock()=0
Botan::Invalid_Argument
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.

References Botan::Mutex::unlock().

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

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

- src/mutex/mutex.h