summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-08 23:09:49 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-08 23:09:49 +0300
commit4f948c82ea95c6b9fac307f455fe91851e27017a (patch)
tree4eaa6aecdd68e2da17433517212b92028bf565e0 /src/net/tmwa
parent72e775bac71b2d4b5103a0e8a6f03875b1617321 (diff)
downloadmv-4f948c82ea95c6b9fac307f455fe91851e27017a.tar.gz
mv-4f948c82ea95c6b9fac307f455fe91851e27017a.tar.bz2
mv-4f948c82ea95c6b9fac307f455fe91851e27017a.tar.xz
mv-4f948c82ea95c6b9fac307f455fe91851e27017a.zip
split network mutexe into read and write mutexes.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/network.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 175713d49..9c1508ccb 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -141,7 +141,7 @@ void Network::dispatchMessages()
BLOCK_START("Network::dispatchMessages 1")
while (messageReady())
{
- SDL_mutexP(mMutex);
+ SDL_mutexP(mMutexIn);
BLOCK_START("Network::dispatchMessages 2")
const int msgId = readWord(0);
int len;
@@ -156,7 +156,7 @@ void Network::dispatchMessages()
len = readWord(2);
MessageIn msg(mInBuffer, len);
- SDL_mutexV(mMutex);
+ SDL_mutexV(mMutexIn);
BLOCK_END("Network::dispatchMessages 2")
BLOCK_START("Network::dispatchMessages 3")
@@ -187,7 +187,7 @@ bool Network::messageReady()
{
int len = -1;
- SDL_mutexP(mMutex);
+ SDL_mutexP(mMutexIn);
if (mInSize >= 2)
{
const int msgId = readWord(0);
@@ -210,7 +210,7 @@ bool Network::messageReady()
}
const bool ret = (mInSize >= static_cast<unsigned int>(len));
- SDL_mutexV(mMutex);
+ SDL_mutexV(mMutexIn);
return ret;
}