From a71299c46b7b53a5f9f11ea2851f8e5b66d2d912 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 15:41:01 +0000 Subject: fixed rdynamic as its not acctually needed a cmake handles it, looks like the problem was caused by the linux linker accepting the option twice and the os x linker not --- src/OSSupport/Queue.h | 31 +++++++++++++++++++++++++++++++ src/WorldStorage/WorldStorage.h | 3 ++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/OSSupport/Queue.h (limited to 'src') diff --git a/src/OSSupport/Queue.h b/src/OSSupport/Queue.h new file mode 100644 index 000000000..4571272b3 --- /dev/null +++ b/src/OSSupport/Queue.h @@ -0,0 +1,31 @@ +#pragma once + +template +class cDeleter +{ + public: + static void Delete(T) {}; +}; + +template> +class cQueue +{ +public: + cQueue(int warnsize); + cQueue(cQueue& queue); + ~cQueue(); + + void EnqueueItem(T item); + bool TryDequeueItem(T& item); + T DequeueItem(); + void BlockTillEmpty(cEvent CancelationEvent); + void Clear(); + int Size(); + +private: + int warnsize; + std::list contents; +}; + +//template classes must be implemented in the header +#include "Queue.inc" diff --git a/src/WorldStorage/WorldStorage.h b/src/WorldStorage/WorldStorage.h index 007d37571..106842a22 100644 --- a/src/WorldStorage/WorldStorage.h +++ b/src/WorldStorage/WorldStorage.h @@ -16,6 +16,7 @@ #include "../ChunkDef.h" #include "../OSSupport/IsThread.h" +#include "../OSSupport/Queue.h" @@ -93,7 +94,7 @@ protected: sChunkLoad(int a_ChunkX, int a_ChunkY, int a_ChunkZ, bool a_Generate) : m_ChunkX(a_ChunkX), m_ChunkY(a_ChunkY), m_ChunkZ(a_ChunkZ), m_Generate(a_Generate) {} } ; - typedef std::list sChunkLoadQueue; + typedef cQueue sChunkLoadQueue; cWorld * m_World; AString m_StorageSchemaName; -- cgit v1.2.3