From a70382b0e8bed265a1d314d9f6aae8f2dd48d20b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Nov 2012 18:45:54 +0000 Subject: ex-protos moved to the Plugins folder git-svn-id: http://svn.miranda-ng.org/main/trunk@2545 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Quotes/src/LightMutex.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 plugins/Quotes/src/LightMutex.h (limited to 'plugins/Quotes/src/LightMutex.h') diff --git a/plugins/Quotes/src/LightMutex.h b/plugins/Quotes/src/LightMutex.h new file mode 100644 index 0000000000..e8c7363ba1 --- /dev/null +++ b/plugins/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