1
0

Fixed *nix threading issue;

Thread objects now use variable names consistent with MCS convention;
Fixed a few *nix threading cornercases

git-svn-id: http://mc-server.googlecode.com/svn/trunk@392 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-03-10 17:37:00 +00:00
parent e5b91a8d97
commit 1a5ebb44aa
11 changed files with 93 additions and 88 deletions

View File

@@ -153,10 +153,11 @@ void cWorldStorage::WaitForFinish(void)
}
// Wait for the thread to finish:
mShouldTerminate = true;
m_ShouldTerminate = true;
m_Event.Set();
m_evtRemoved.Set(); // Wake up anybody waiting in the WaitForQueuesEmpty() method
super::Wait();
LOG("World storage thread finished");
}
@@ -166,7 +167,7 @@ void cWorldStorage::WaitForFinish(void)
void cWorldStorage::WaitForQueuesEmpty(void)
{
cCSLock Lock(m_CSQueues);
while (!mShouldTerminate && (!m_LoadQueue.empty() || !m_SaveQueue.empty()))
while (!m_ShouldTerminate && (!m_LoadQueue.empty() || !m_SaveQueue.empty()))
{
cCSUnlock Unlock(Lock);
m_evtRemoved.Wait();
@@ -305,7 +306,7 @@ void cWorldStorage::InitSchemas(void)
void cWorldStorage::Execute(void)
{
while (!mShouldTerminate)
while (!m_ShouldTerminate)
{
m_Event.Wait();
@@ -314,7 +315,7 @@ void cWorldStorage::Execute(void)
do
{
HasMore = false;
if (mShouldTerminate)
if (m_ShouldTerminate)
{
return;
}