diff options
author | madmaxoft <github@xoft.cz> | 2014-02-08 22:33:42 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-02-08 22:33:42 +0100 |
commit | df0ecc6c078cf06c5aba025bb8d77569ca91c748 (patch) | |
tree | 2e73acadd2aa772787b43ebc9493523a0ca4967a | |
parent | Fixed ChunkStay initialization. (diff) | |
download | cuberite-df0ecc6c078cf06c5aba025bb8d77569ca91c748.tar cuberite-df0ecc6c078cf06c5aba025bb8d77569ca91c748.tar.gz cuberite-df0ecc6c078cf06c5aba025bb8d77569ca91c748.tar.bz2 cuberite-df0ecc6c078cf06c5aba025bb8d77569ca91c748.tar.lz cuberite-df0ecc6c078cf06c5aba025bb8d77569ca91c748.tar.xz cuberite-df0ecc6c078cf06c5aba025bb8d77569ca91c748.tar.zst cuberite-df0ecc6c078cf06c5aba025bb8d77569ca91c748.zip |
Diffstat (limited to '')
-rw-r--r-- | src/LightingThread.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index b665066ee..8fbfb29db 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -136,11 +136,13 @@ void cLightingThread::QueueChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback ASSERT(m_World != NULL); // Did you call Start() properly? cChunkStay * ChunkStay = new cLightingChunkStay(*this, a_ChunkX, a_ChunkZ, a_CallbackAfter); + { + cCSLock Lock(m_CS); + m_PendingQueue.push_back(ChunkStay); + } ChunkStay->Enable(*m_World->GetChunkMap()); // The ChunkStay will enqueue itself using the QueueChunkStay() once it is fully loaded // In the meantime, put it into the PendingQueue so that it can be removed when stopping the thread - cCSLock Lock(m_CS); - m_PendingQueue.push_back(ChunkStay); } |