diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-11 11:20:18 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-11 11:20:18 +0000 |
commit | b86e3b7cd68112b06c2a54be9fb262d45a65833a (patch) | |
tree | eaf5598db4eadb6f8fada65019d51ae650a39c65 /protocols/Tlen/src/tlen_util.cpp | |
parent | e6040d454c758e72333132dc05ee72d910b78bed (diff) |
minus critical section
git-svn-id: http://svn.miranda-ng.org/main/trunk@13524 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/tlen_util.cpp')
-rw-r--r-- | protocols/Tlen/src/tlen_util.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/protocols/Tlen/src/tlen_util.cpp b/protocols/Tlen/src/tlen_util.cpp index 981c6da6fb..228f8dae8e 100644 --- a/protocols/Tlen/src/tlen_util.cpp +++ b/protocols/Tlen/src/tlen_util.cpp @@ -28,24 +28,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void TlenSerialInit(TlenProtocol *proto)
{
- InitializeCriticalSection(&proto->csSerial);
proto->serial = 0;
}
-void TlenSerialUninit(TlenProtocol *proto)
-{
- DeleteCriticalSection(&proto->csSerial);
-}
-
-
unsigned int TlenSerialNext(TlenProtocol *proto)
{
unsigned int ret;
- EnterCriticalSection(&proto->csSerial);
+ mir_cslock lck(proto->csSerial);
ret = proto->serial;
proto->serial++;
- LeaveCriticalSection(&proto->csSerial);
return ret;
}
@@ -58,7 +50,7 @@ int TlenSend(TlenProtocol *proto, const char *fmt, ...) va_list vararg;
int result = 0;
- EnterCriticalSection(&proto->csSend);
+ mir_cslock lck(proto->csSend);
va_start(vararg,fmt);
size = 512;
@@ -78,7 +70,6 @@ int TlenSend(TlenProtocol *proto, const char *fmt, ...) result = TlenWsSend(proto, proto->threadData->s, str, size);
}
}
- LeaveCriticalSection(&proto->csSend);
mir_free(str);
return result;
|