From bb4e8721d14fbbcf8cafc976ba882326109f3ccf Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 30 Apr 2015 18:52:54 +0000 Subject: minus critical section git-svn-id: http://svn.miranda-ng.org/main/trunk@13302 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Exchange/src/MirandaExchange.h | 2 +- plugins/Exchange/src/commonheaders.h | 26 +++++++------------------- plugins/Exchange/src/services.cpp | 6 ------ plugins/Exchange/src/services.h | 2 -- plugins/Exchange/src/utils.cpp | 6 +++--- 5 files changed, 11 insertions(+), 31 deletions(-) (limited to 'plugins') diff --git a/plugins/Exchange/src/MirandaExchange.h b/plugins/Exchange/src/MirandaExchange.h index 9644e69fdb..e4ca0b3ad8 100644 --- a/plugins/Exchange/src/MirandaExchange.h +++ b/plugins/Exchange/src/MirandaExchange.h @@ -231,7 +231,7 @@ private: bool m_bNoInitAgain; UINT m_nNumberOfHeaders; - CRITICAL_SECTION m_myCritical; + mir_cs m_myCritical; }; diff --git a/plugins/Exchange/src/commonheaders.h b/plugins/Exchange/src/commonheaders.h index 656dc8af13..3fe791c0a1 100644 --- a/plugins/Exchange/src/commonheaders.h +++ b/plugins/Exchange/src/commonheaders.h @@ -28,38 +28,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DEFAULT_RECONNECT_INTERVAL 10 //in minutes #include -//#include #include #include - -#include "resource.h" - -#include "version.h" -#include "utils.h" -#include "emails.h" -#include "services.h" -#include "hooked_events.h" -//#include "mirandaMem.h" - -//#include "forkthread.h" - #include #include #include #include #include -//#include "m_skin.h" +#include #include #include #include -//#include "m_history.h" -//#include "m_contacts.h" -//#include "m_fontservice.h" - #include "m_utils.h" -//#include "m_updater.h" +#include "resource.h" +#include "version.h" +#include "utils.h" +#include "emails.h" +#include "services.h" +#include "hooked_events.h" extern char ModuleName[]; extern HINSTANCE hInstance; diff --git a/plugins/Exchange/src/services.cpp b/plugins/Exchange/src/services.cpp index e5999ac50a..c6a7beb665 100644 --- a/plugins/Exchange/src/services.cpp +++ b/plugins/Exchange/src/services.cpp @@ -21,21 +21,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" #include "services.h" -CRITICAL_SECTION csCheck; - int InitServices() { CreateServiceFunction(MS_EXCHANGE_CHECKEMAIL, (MIRANDASERVICE) CheckEmailService); - InitializeCriticalSection(&csCheck); - return 0; } int DestroyServices() { DestroyServiceFunction(MS_EXCHANGE_CHECKEMAIL); - DeleteCriticalSection(&csCheck); - return 0; } diff --git a/plugins/Exchange/src/services.h b/plugins/Exchange/src/services.h index f1c549dedd..f445c69b42 100644 --- a/plugins/Exchange/src/services.h +++ b/plugins/Exchange/src/services.h @@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MS_EXCHANGE_CHECKEMAIL "Exchange/CheckEmail" -extern CRITICAL_SECTION csCheck; - int InitServices(); int DestroyServices(); diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index 4a2ff20514..4208576f9f 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define ___DEB +mir_cs csCheck; + int LogInit() { #ifdef ___DEBUGG @@ -201,7 +203,7 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, DWORD WINAPI CheckEmailWorkerThread(LPVOID data) { - EnterCriticalSection(&csCheck); + mir_cslock lck(csCheck); int bForceAttempt = (int) data; @@ -210,8 +212,6 @@ DWORD WINAPI CheckEmailWorkerThread(LPVOID data) exchangeServer.Check(bForceAttempt); - LeaveCriticalSection(&csCheck); - return 0; } -- cgit v1.2.3