From 5df94ff719eccd04c7450df35fb5e3f2b36e2ee7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 13 Jul 2014 10:50:59 +0000 Subject: wrapping the most evident critical sections into a class git-svn-id: http://svn.miranda-ng.org/main/trunk@9785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/packets.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'protocols/AimOscar/src/packets.cpp') diff --git a/protocols/AimOscar/src/packets.cpp b/protocols/AimOscar/src/packets.cpp index 3a4a5fc7f6..f4f44ab8bf 100644 --- a/protocols/AimOscar/src/packets.cpp +++ b/protocols/AimOscar/src/packets.cpp @@ -65,7 +65,7 @@ int aim_writetlvlong64(unsigned short type, unsigned __int64 value, unsigned sho int CAimProto::aim_sendflap(HANDLE hServerConn, char type,unsigned short length,const char *buf, unsigned short &seqno) { - EnterCriticalSection(&SendingMutex); + mir_cslock lck(SendingMutex); const int slen = FLAP_SIZE + length; char* obuf = (char*)alloca(slen); flap_header *flap = (flap_header*)obuf; @@ -76,7 +76,6 @@ int CAimProto::aim_sendflap(HANDLE hServerConn, char type,unsigned short length, memcpy(&obuf[FLAP_SIZE], buf, length); int rlen= Netlib_Send(hServerConn, obuf, slen, 0); if (rlen == SOCKET_ERROR) seqno--; - LeaveCriticalSection(&SendingMutex); return rlen >= 0 ? 0 : -1; } -- cgit v1.2.3