summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-rw-r--r--lib/lua/Makefile54
-rw-r--r--src/OSSupport/Queue.h31
-rw-r--r--src/WorldStorage/WorldStorage.h3
4 files changed, 33 insertions, 62 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 859575a69..f8c740ae3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,12 +117,5 @@ else()
endif()
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_BAK}")
-if (NOT WIN32)
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
- set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -rdynamic")
- set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -rdynamic")
- set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_PROFILE} -rdynamic")
-endif()
-
add_subdirectory (src)
diff --git a/lib/lua/Makefile b/lib/lua/Makefile
index d23c39cc1..8c8cf168a 100644
--- a/lib/lua/Makefile
+++ b/lib/lua/Makefile
@@ -733,54 +733,6 @@ src/ltm.c.s:
cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/ltm.c.s
.PHONY : src/ltm.c.s
-src/lua.o: src/lua.c.o
-.PHONY : src/lua.o
-
-# target to build an object file
-src/lua.c.o:
- cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/lua.c.o
-.PHONY : src/lua.c.o
-
-src/lua.i: src/lua.c.i
-.PHONY : src/lua.i
-
-# target to preprocess a source file
-src/lua.c.i:
- cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/lua.c.i
-.PHONY : src/lua.c.i
-
-src/lua.s: src/lua.c.s
-.PHONY : src/lua.s
-
-# target to generate assembly for a file
-src/lua.c.s:
- cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/lua.c.s
-.PHONY : src/lua.c.s
-
-src/luac.o: src/luac.c.o
-.PHONY : src/luac.o
-
-# target to build an object file
-src/luac.c.o:
- cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/luac.c.o
-.PHONY : src/luac.c.o
-
-src/luac.i: src/luac.c.i
-.PHONY : src/luac.i
-
-# target to preprocess a source file
-src/luac.c.i:
- cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/luac.c.i
-.PHONY : src/luac.c.i
-
-src/luac.s: src/luac.c.s
-.PHONY : src/luac.s
-
-# target to generate assembly for a file
-src/luac.c.s:
- cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/luac.c.s
-.PHONY : src/luac.c.s
-
src/lundump.o: src/lundump.c.o
.PHONY : src/lundump.o
@@ -964,12 +916,6 @@ help:
@echo "... src/ltm.o"
@echo "... src/ltm.i"
@echo "... src/ltm.s"
- @echo "... src/lua.o"
- @echo "... src/lua.i"
- @echo "... src/lua.s"
- @echo "... src/luac.o"
- @echo "... src/luac.i"
- @echo "... src/luac.s"
@echo "... src/lundump.o"
@echo "... src/lundump.i"
@echo "... src/lundump.s"
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 T>
+class cDeleter
+{
+ public:
+ static void Delete(T) {};
+};
+
+template<class T, class D = cDeleter<T>>
+class cQueue
+{
+public:
+ cQueue(int warnsize);
+ cQueue(cQueue<T>& 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<T> 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<sChunkLoad> sChunkLoadQueue;
+ typedef cQueue<sChunkLoad> sChunkLoadQueue;
cWorld * m_World;
AString m_StorageSchemaName;