From a6ce02772dde52fd7b1de9d4b7ba6949c8b2316f Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 30 Apr 2015 19:30:44 +0000 Subject: minus critical section git-svn-id: http://svn.miranda-ng.org/main/trunk@13311 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/hdr/modern_image_array.h | 2 +- .../Clist_modern/src/hdr/modern_skinned_profile.h | 51 +--------------------- 2 files changed, 2 insertions(+), 51 deletions(-) (limited to 'plugins/Clist_modern/src/hdr') diff --git a/plugins/Clist_modern/src/hdr/modern_image_array.h b/plugins/Clist_modern/src/hdr/modern_image_array.h index e45b3c4fef..a5acd94588 100644 --- a/plugins/Clist_modern/src/hdr/modern_image_array.h +++ b/plugins/Clist_modern/src/hdr/modern_image_array.h @@ -52,7 +52,7 @@ struct IMAGE_ARRAY_DATA void * lpBits; // CS - CRITICAL_SECTION cs; + mir_cs cs; // Array IMAGE_ARRAY_DATA_NODE *nodes; diff --git a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h index 6da6e33821..87b4498313 100644 --- a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h +++ b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h @@ -47,55 +47,6 @@ public: }; -class CAutoCriticalSection -{ -public: - CAutoCriticalSection() //Init critical section here - : _pLinkedCS(NULL) - { - InitializeCriticalSection(&_CS); - _ifCSOwner = true; - _ifLocked = false; - } - CAutoCriticalSection(CAutoCriticalSection& Locker, bool doLock = true) - : _pLinkedCS(&Locker) - { - _ifCSOwner = false; - _ifLocked = false; - if (doLock) - Lock(); - } - ~CAutoCriticalSection() // Leave if auto locker, and destroy if not - { - if (_ifLocked) - Unlock(); - if (_ifCSOwner) - DeleteCriticalSection(&_CS); - } - - void Lock() // Enter Section - { - if (_ifLocked) return; - if (_ifCSOwner) EnterCriticalSection(&_CS); - else _pLinkedCS->Lock(); - _ifLocked = true; - return; - } - void Unlock() // Leave Section - { - if (!_ifLocked) return; - if (_ifCSOwner) LeaveCriticalSection(&_CS); - else _pLinkedCS->Unlock(); - _ifLocked = false; - } - -private: - CRITICAL_SECTION _CS; - CAutoCriticalSection * _pLinkedCS; - bool _ifCSOwner; - bool _ifLocked; -}; - class ValueVariant { public: @@ -225,7 +176,7 @@ private: ValueVariant* _GetValue(const char * szSection, const char * szKey); - CAutoCriticalSection _Lock; // critical section to matable skinned profile access + mir_cs _Lock; // critical section to matable skinned profile access public: static CSkinnedProfile* SkinProfile() { return &_me; } -- cgit v1.2.3