From 70551c0b0af18604fbf3e934f468c5c0df7cf66f Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 30 Apr 2015 09:23:36 +0000 Subject: minus critical section git-svn-id: http://svn.miranda-ng.org/main/trunk@13284 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/LotusNotify/src/LotusNotify.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'plugins/LotusNotify/src') diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 9526c144f7..7c0b9f5e69 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -28,7 +28,7 @@ HINSTANCE hLotusDll; HEMREGISTRATION hLotusRegister = 0; boolean volatile Plugin_Terminated = false; -CRITICAL_SECTION checkthreadCS; +mir_cs checkthreadCS; HANDLE hMenuService = NULL; HGENMENU hMenuHandle = NULL; @@ -605,7 +605,7 @@ void checkthread(void*) WCHAR field_to_UNICODE[MAX_FIELD]; WCHAR field_copy_UNICODE[MAX_FIELD]; - EnterCriticalSection(&checkthreadCS); + mir_cslock lck(checkthreadCS); log(L"checkthread: inside new check thread"); if (error = (NotesInitThread1)()) { @@ -832,7 +832,6 @@ void checkthread(void*) if(currentStatus != ID_STATUS_OFFLINE){ LNEnableMenuItem(hMenuHandle, !running); } - LeaveCriticalSection(&checkthreadCS); return; errorblock0: @@ -846,7 +845,6 @@ errorblock: //LNEnableMenuItem(hMenuHandle,!running); //SetStatus(ID_STATUS_OFFLINE,0); running = FALSE; - LeaveCriticalSection(&checkthreadCS); return; } @@ -1574,7 +1572,6 @@ extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); Plugin_Terminated = false; - InitializeCriticalSection(&checkthreadCS); //if(pluginLink)//strange, but this function is called by Lotus API Extension Manager (instead of MainEntryPoint) probably always with parameter poiter =1 if(bMirandaCall){ @@ -1662,9 +1659,7 @@ extern "C" int __declspec(dllexport) Unload() log(L"Unload: start"); Plugin_Terminated = true; - EnterCriticalSection(&checkthreadCS); - LeaveCriticalSection(&checkthreadCS); - DeleteCriticalSection(&checkthreadCS); + mir_cslock lck(checkthreadCS); if (hMenuService) DestroyServiceFunction(hMenuService); if (hCheckEvent) DestroyHookableEvent(hCheckEvent); -- cgit v1.2.3