Botan: Botan::Win32_Mutex_Factory Class Reference

Botan 1.10.16

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

`#include <mux_win32.h>`

Inheritance diagram for Botan::Win32_Mutex_Factory:

## Public Member Functions
Mutex * | make ()

## Detailed Description

Win32 Mutex Factory

Definition at line 19 of file mux_win32.h.

## Member Function Documentation

## ◆ make()

Mutex * Botan::Win32_Mutex_Factory::make | ( |  | ) |
| virtual

Returns
  newly allocated mutex

Implements Botan::Mutex_Factory.

Definition at line 17 of file mux_win32.cpp.

18 {
19 class Win32_Mutex : public Mutex
20 {
21 public:
22 void lock() { EnterCriticalSection(&mutex); }
23 void unlock() { LeaveCriticalSection(&mutex); }
24
25 Win32_Mutex() { InitializeCriticalSection(&mutex); }
26 ~Win32_Mutex() { DeleteCriticalSection(&mutex); }
27 private:
28 CRITICAL_SECTION mutex;
29 };
30
31 return new Win32_Mutex();
32 }

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

- src/mutex/win32_crit_section/mux_win32.h
- src/mutex/win32_crit_section/mux_win32.cpp