diff options
author | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
commit | a2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch) | |
tree | ad3d6c4fcc8dd0f403f8105598943616246fe172 /modules/mux_win32/mux_win32.cpp |
Initial checkin1.5.6
Diffstat (limited to 'modules/mux_win32/mux_win32.cpp')
-rw-r--r-- | modules/mux_win32/mux_win32.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/mux_win32/mux_win32.cpp b/modules/mux_win32/mux_win32.cpp new file mode 100644 index 000000000..400aea183 --- /dev/null +++ b/modules/mux_win32/mux_win32.cpp @@ -0,0 +1,39 @@ +/************************************************* +* Win32 Mutex Source File * +* (C) 1999-2006 The Botan Project * +*************************************************/ + +#include <botan/mux_win32.h> +#include <botan/exceptn.h> +#include <windows.h> + +namespace Botan { + +namespace { + +/************************************************* +* Win32 Mutex * +*************************************************/ +class Win32_Mutex : public Mutex + { + public: + void lock() { EnterCriticalSection(&mutex); } + void unlock() { LeaveCriticalSection(&mutex); } + + Win32_Mutex() { InitializeCriticalSection(&mutex); } + ~Win32_Mutex() { DeleteCriticalSection(&mutex); } + private: + CRITICAL_SECTION mutex; + }; + +} + +/************************************************* +* Win32 Mutex Factory * +*************************************************/ +Mutex* Win32_Mutex_Factory::make() + { + return new Win32_Mutex(); + } + +} |