diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-13 10:50:59 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-13 10:50:59 +0000 |
commit | 5df94ff719eccd04c7450df35fb5e3f2b36e2ee7 (patch) | |
tree | 440d736b199ff849ca0619adf355ffc73750ca7f /protocols/AimOscar/src/utility.cpp | |
parent | 70496fb739225b559a251f4518c946110aef718c (diff) |
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
Diffstat (limited to 'protocols/AimOscar/src/utility.cpp')
-rw-r--r-- | protocols/AimOscar/src/utility.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 00af4417d4..28678182a4 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -135,15 +135,14 @@ bool CAimProto::wait_conn(HANDLE& hConn, HANDLE& hEvent, unsigned short service) {
if (m_iStatus == ID_STATUS_OFFLINE)
return false;
-
- EnterCriticalSection(&connMutex);
- if (hConn == NULL && hServerConn)
{
- debugLogA("Starting Connection.");
- hConn = (HANDLE)1; //set so no additional service request attempts are made while aim is still processing the request
- aim_new_service_request(hServerConn, seqno, service) ;//general service connection!
+ mir_cslock lck(connMutex);
+ if (hConn == NULL && hServerConn) {
+ debugLogA("Starting Connection.");
+ hConn = (HANDLE)1; //set so no additional service request attempts are made while aim is still processing the request
+ aim_new_service_request(hServerConn, seqno, service);//general service connection!
+ }
}
- LeaveCriticalSection(&connMutex);
if (WaitForSingleObjectEx(hEvent, 10000, TRUE) != WAIT_OBJECT_0)
return false;
|