summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WorldStorage.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2014-01-02 13:32:55 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2014-01-02 13:32:55 +0100
commit042b72bc172e7eb4e9ef7668ae28be6e7a3b4036 (patch)
tree7e3d265d3d1fde9f80f3f4623c2f59a5b0521b65 /src/WorldStorage/WorldStorage.cpp
parentMerge branch 'master' into threadsafequeue (diff)
downloadcuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.gz
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.bz2
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.lz
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.xz
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.zst
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.zip
Diffstat (limited to 'src/WorldStorage/WorldStorage.cpp')
-rw-r--r--src/WorldStorage/WorldStorage.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/WorldStorage/WorldStorage.cpp b/src/WorldStorage/WorldStorage.cpp
index c3bfbd4f6..9ad995c82 100644
--- a/src/WorldStorage/WorldStorage.cpp
+++ b/src/WorldStorage/WorldStorage.cpp
@@ -13,7 +13,6 @@
#include "../Generating/ChunkGenerator.h"
#include "../Entities/Entity.h"
#include "../BlockEntities/BlockEntity.h"
-#include "../OSSupport/Promise.h"
@@ -100,7 +99,7 @@ void cWorldStorage::WaitForFinish(void)
}
// Wait for the saving to finish:
- WaitForQueuesEmpty();
+ WaitForSaveQueueEmpty();
// Wait for the thread to finish:
m_ShouldTerminate = true;
@@ -114,21 +113,15 @@ void cWorldStorage::WaitForFinish(void)
-void cWorldStorage::WaitForQueuesEmpty(void)
+void cWorldStorage::WaitForLoadQueueEmpty(void)
{
-
- cPromise * LoadPromise = m_LoadQueue.BlockTillEmpty();
- cPromise * SavePromise = m_SaveQueue.BlockTillEmpty();
- cPromise * QueuePromise = LoadPromise->WaitFor(SavePromise);
- cPromise * CancelPromise = QueuePromise->CancelOn(m_ShouldTerminate);
- CancelPromise->Wait();
- delete CancelPromise;
- delete QueuePromise;
- delete SavePromise;
- delete LoadPromise;
+ m_LoadQueue.BlockTillEmpty();
}
-
+void cWorldStorage::WaitForSaveQueueEmpty(void)
+{
+ m_SaveQueue.BlockTillEmpty();
+}