about summary refs log tree commit diff
path: root/src/engine/client/backend_sdl.h
diff options
context:
space:
mode:
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;