about summary refs log tree commit diff
path: root/src/engine/client/backend_sdl.h
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2012-06-10 12:14:41 +0200
committeroy <Tom_Adams@web.de>2013-02-24 17:35:51 +0100
commitb7e5bb54ad77545ae139115a1a64f9ebb7160006 (patch)
tree020e1c8f563e63a7753274a2f2a49d63e3722a94 /src/engine/client/backend_sdl.h
parent1a62770a5691157f83061eedd2e3ce7d3fa33f62 (diff)
downloadzcatch-b7e5bb54ad77545ae139115a1a64f9ebb7160006.tar.gz
zcatch-b7e5bb54ad77545ae139115a1a64f9ebb7160006.zip
fixed semaphore on macosx
Diffstat (limited to 'src/engine/client/backend_sdl.h')
-rw-r--r--src/engine/client/backend_sdl.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/client/backend_sdl.h b/src/engine/client/backend_sdl.h
index 305453f2..2ef04a1f 100644
--- a/src/engine/client/backend_sdl.h
+++ b/src/engine/client/backend_sdl.h
@@ -30,6 +30,16 @@
 
 	#include <AGL/agl.h>
 
+	class semaphore
+	{
+		SDL_sem *sem;
+	public:
+		semaphore() { sem = SDL_CreateSemaphore(0); }
+		~semaphore() { SDL_DestroySemaphore(sem); }
+		void wait() { SDL_SemWait(sem); }
+		void signal() { SDL_SemPost(sem); }
+	};
+
 	struct SGLContext
 	{
 		AGLContext m_Context;