From f7d2c07c102d940727b0f053864c04ed32a76ff8 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 13 Oct 2012 09:49:24 +0000 Subject: Quotes: folders restructurization git-svn-id: http://svn.miranda-ng.org/main/trunk@1905 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Quotes/src/LightMutex.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 protocols/Quotes/src/LightMutex.h (limited to 'protocols/Quotes/src/LightMutex.h') diff --git a/protocols/Quotes/src/LightMutex.h b/protocols/Quotes/src/LightMutex.h new file mode 100644 index 0000000000..e8c7363ba1 --- /dev/null +++ b/protocols/Quotes/src/LightMutex.h @@ -0,0 +1,34 @@ +#ifndef __a33da2bb_d4fe4aa7_aaf5_f9f8c3156ce6_LightMutex_h__ +#define __a33da2bb_d4fe4aa7_aaf5_f9f8c3156ce6_LightMutex_h__ + +class CLightMutex +{ +public: + CLightMutex(); + ~CLightMutex(); + + void Lock(); + void Unlock(); + +private: + CRITICAL_SECTION m_cs; +}; + +template class CGuard +{ +public: + CGuard(TObject& obj) : m_obj(obj) + { + m_obj.Lock(); + } + + ~CGuard() + { + m_obj.Unlock(); + } + +private: + TObject& m_obj; +}; + +#endif //__a33da2bb_d4fe4aa7_aaf5_f9f8c3156ce6_LightMutex_h__ -- cgit v1.2.3