1
0

Fixed a problem in cCSLock (sorry); reverted cChunk

git-svn-id: http://mc-server.googlecode.com/svn/trunk@195 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-01-30 21:54:40 +00:00
parent 9dfa0f1f15
commit b834841aa1
2 changed files with 9 additions and 3 deletions

View File

@ -249,7 +249,7 @@ void cChunk::Tick(float a_Dt)
}
m_pState->PendingSendBlocks.clear();
}
cCSUnlock Unlock( Lock );
Lock.Unlock();
while( !m_pState->UnloadQuery.empty() )
{
@ -261,10 +261,10 @@ void cChunk::Tick(float a_Dt)
m_pState->UnloadQuery.remove( *m_pState->UnloadQuery.begin() );
}
m_pState->BlockListCriticalSection.Lock();
cCSLock Lock2(m_pState->BlockListCriticalSection);
std::map< unsigned int, int > ToTickBlocks = m_pState->ToTickBlocks;
m_pState->ToTickBlocks.clear();
m_pState->BlockListCriticalSection.Unlock();
Lock2.Unlock();
bool isRedstone = false;
for( std::map< unsigned int, int>::iterator itr = ToTickBlocks.begin(); itr != ToTickBlocks.end(); ++itr )

View File

@ -107,6 +107,12 @@ cCSLock::cCSLock(cCriticalSection & a_CS)
cCSLock::~cCSLock()
{
#ifdef _DEBUG
if (!m_IsLocked)
{
return;
}
#endif // _DEBUG
Unlock();
}