From 499745c1c7a865941b3c102532777c19dfb92ca4 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 18 Feb 2012 17:53:22 +0000 Subject: Thread-safe chunk generation, storage and generator are queried for progress while initializing server Note that this commit breaks foliage generation - there are no trees in the chunks generated! git-svn-id: http://mc-server.googlecode.com/svn/trunk@292 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunkGenerator.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/cChunkGenerator.h') diff --git a/source/cChunkGenerator.h b/source/cChunkGenerator.h index 8b0efc9e8..cb30636c3 100644 --- a/source/cChunkGenerator.h +++ b/source/cChunkGenerator.h @@ -43,6 +43,10 @@ public: void Stop(void); void GenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Queues the chunk for generation; removes duplicate requests + + void WaitForQueueEmpty(void); + + int GetQueueLength(void); private: @@ -52,6 +56,7 @@ private: cCriticalSection m_CS; cChunkCoordsList m_Queue; cEvent m_Event; // Set when an item is added to the queue or the thread should terminate + cEvent m_evtRemoved; // Set when an item is removed from the queue // cIsThread override: virtual void Execute(void) override; -- cgit v1.2.3