From 82376c5c1f25318bd67fdfbe92219658252f7e0a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 4 Jan 2015 20:19:29 +0000 Subject: minus critical section git-svn-id: http://svn.miranda-ng.org/main/trunk@11772 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdmsg/src/cmdlist.cpp | 11 ++--------- src/core/stdmsg/src/cmdlist.h | 1 - src/core/stdmsg/src/msgs.cpp | 1 - 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index 25ddfce52c..e95b2b2051 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" static LIST msgQueue(5, NumericKeySortT); -static CRITICAL_SECTION csMsgQueue; +static mir_cs csMsgQueue; static UINT_PTR timerId; void MessageFailureProcess(TMsgQueue *item, const char* err); @@ -45,7 +45,7 @@ static VOID CALLBACK MsgTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi MessageFailureProcess(arTimedOut[i], LPGEN("The message send timed out.")); } -void msgQueue_add(MCONTACT hContact, int id, const TCHAR* szMsg, HANDLE hDbEvent) +void msgQueue_add(MCONTACT hContact, int id, const TCHAR *szMsg, HANDLE hDbEvent) { TMsgQueue *item = (TMsgQueue*)mir_alloc(sizeof(TMsgQueue)); item->hContact = hContact; @@ -86,11 +86,6 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char* sz } } -void msgQueue_init(void) -{ - InitializeCriticalSection(&csMsgQueue); -} - void msgQueue_destroy(void) { for (int i = 0; i < msgQueue.getCount(); i++) { @@ -99,6 +94,4 @@ void msgQueue_destroy(void) mir_free(item); } msgQueue.destroy(); - - DeleteCriticalSection(&csMsgQueue); } diff --git a/src/core/stdmsg/src/cmdlist.h b/src/core/stdmsg/src/cmdlist.h index e2076e25d5..caeac3cfd9 100644 --- a/src/core/stdmsg/src/cmdlist.h +++ b/src/core/stdmsg/src/cmdlist.h @@ -33,7 +33,6 @@ struct TMsgQueue void msgQueue_add(MCONTACT hContact, int id, const TCHAR* szMsg, HANDLE hDbEvent); void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char* szErr); -void msgQueue_init(void); void msgQueue_destroy(void); #endif diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 4077bc38b1..2a846769ec 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -391,7 +391,6 @@ int LoadSendRecvMessageModule(void) InitGlobals(); RichUtil_Load(); InitOptions(); - msgQueue_init(); HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, MessageSettingChanged); -- cgit v1.2.3