diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-01-07 13:57:34 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-01-07 13:57:34 +0100 |
commit | 0b79ad0d5dd9d2ddcbff4f7351ebd83ce22fb53f (patch) | |
tree | d2593b129bf0e83d72937cf52e8a9283c85be46a /src/WorldStorage/WorldStorage.cpp | |
parent | Merge branch 'master' of github.com:mc-server/MCServer (diff) | |
parent | Added Base64Encode(). (diff) | |
download | cuberite-0b79ad0d5dd9d2ddcbff4f7351ebd83ce22fb53f.tar cuberite-0b79ad0d5dd9d2ddcbff4f7351ebd83ce22fb53f.tar.gz cuberite-0b79ad0d5dd9d2ddcbff4f7351ebd83ce22fb53f.tar.bz2 cuberite-0b79ad0d5dd9d2ddcbff4f7351ebd83ce22fb53f.tar.lz cuberite-0b79ad0d5dd9d2ddcbff4f7351ebd83ce22fb53f.tar.xz cuberite-0b79ad0d5dd9d2ddcbff4f7351ebd83ce22fb53f.tar.zst cuberite-0b79ad0d5dd9d2ddcbff4f7351ebd83ce22fb53f.zip |
Diffstat (limited to 'src/WorldStorage/WorldStorage.cpp')
-rw-r--r-- | src/WorldStorage/WorldStorage.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/WorldStorage/WorldStorage.cpp b/src/WorldStorage/WorldStorage.cpp index 5f4c112d5..6aec525a8 100644 --- a/src/WorldStorage/WorldStorage.cpp +++ b/src/WorldStorage/WorldStorage.cpp @@ -117,6 +117,10 @@ void cWorldStorage::WaitForLoadQueueEmpty(void) m_LoadQueue.BlockTillEmpty(); } + + + + void cWorldStorage::WaitForSaveQueueEmpty(void) { m_SaveQueue.BlockTillEmpty(); @@ -124,6 +128,8 @@ void cWorldStorage::WaitForSaveQueueEmpty(void) + + size_t cWorldStorage::GetLoadQueueLength(void) { return m_LoadQueue.Size(); @@ -144,8 +150,8 @@ size_t cWorldStorage::GetSaveQueueLength(void) void cWorldStorage::QueueLoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, bool a_Generate) { - m_Event.Set(); m_LoadQueue.EnqueueItemIfNotPresent(sChunkLoad(a_ChunkX, a_ChunkY, a_ChunkZ, a_Generate)); + m_Event.Set(); } @@ -154,8 +160,8 @@ void cWorldStorage::QueueLoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, boo void cWorldStorage::QueueSaveChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ) { - m_Event.Set(); m_SaveQueue.EnqueueItemIfNotPresent(cChunkCoords(a_ChunkX, a_ChunkY, a_ChunkZ)); + m_Event.Set(); } @@ -166,6 +172,7 @@ void cWorldStorage::QueueSavedMessage(void) { // Pushes a special coord pair into the queue, signalizing a message instead m_SaveQueue.EnqueueItem(cChunkCoords(0, CHUNK_Y_MESSAGE, 0)); + m_Event.Set(); } |