summaryrefslogtreecommitdiffstats
path: root/source/WorldStorage.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-18 18:53:22 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-18 18:53:22 +0100
commit499745c1c7a865941b3c102532777c19dfb92ca4 (patch)
treedeccb8ffdafe6dbb85e8e630eaca0a6e5a66c5ed /source/WorldStorage.h
parentLogging: added thread ID to the log output in debug builds (diff)
downloadcuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.gz
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.bz2
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.lz
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.xz
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.zst
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.zip
Diffstat (limited to '')
-rw-r--r--source/WorldStorage.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/WorldStorage.h b/source/WorldStorage.h
index 220585c57..1ea39cf66 100644
--- a/source/WorldStorage.h
+++ b/source/WorldStorage.h
@@ -105,19 +105,23 @@ public:
bool Start(cWorld * a_World, const AString & a_StorageSchemaName); // Hide the cIsThread's Start() method, we need to provide args
void WaitForFinish(void);
+ void WaitForQueuesEmpty(void);
+
+ int GetLoadQueueLength(void);
+ int GetSaveQueueLength(void);
protected:
cWorld * m_World;
AString m_StorageSchemaName;
- cCriticalSection m_CSLoadQueue;
- cChunkCoordsList m_LoadQueue;
-
- cCriticalSection m_CSSaveQueue;
- cChunkCoordsList m_SaveQueue;
+ // Both queues are locked by the same CS
+ cCriticalSection m_CSQueues;
+ cChunkCoordsList m_LoadQueue;
+ cChunkCoordsList m_SaveQueue;
- cEvent m_Event; // Set when there's any addition to the queues
+ cEvent m_Event; // Set when there's any addition to the queues
+ cEvent m_evtRemoved; // Set when an item has been removed from the queue, either by the worker thread or the Unqueue methods
/// All the storage schemas (all used for loading)
cWSSchemaList m_Schemas;