about summary refs log tree commit diff
path: root/src/base/tl
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/base/tl
parent1a62770a5691157f83061eedd2e3ce7d3fa33f62 (diff)
downloadzcatch-b7e5bb54ad77545ae139115a1a64f9ebb7160006.tar.gz
zcatch-b7e5bb54ad77545ae139115a1a64f9ebb7160006.zip
fixed semaphore on macosx
Diffstat (limited to 'src/base/tl')
-rw-r--r--src/base/tl/threading.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/base/tl/threading.h b/src/base/tl/threading.h
index dbf788cd..5caf8588 100644
--- a/src/base/tl/threading.h
+++ b/src/base/tl/threading.h
@@ -58,15 +58,21 @@
 	#error missing atomic implementation for this compiler
 #endif
 
-class semaphore
-{
-	SEMAPHORE sem;
-public:
-	semaphore() { semaphore_init(&sem); }
-	~semaphore() { semaphore_destroy(&sem); }
-	void wait() { semaphore_wait(&sem); }
-	void signal() { semaphore_signal(&sem); }
-};
+#if defined(CONF_PLATFORM_MACOSX)
+	/*
+		use semaphore provided by SDL on macosx
+	*/
+#else
+	class semaphore
+	{
+		SEMAPHORE sem;
+	public:
+		semaphore() { semaphore_init(&sem); }
+		~semaphore() { semaphore_destroy(&sem); }
+		void wait() { semaphore_wait(&sem); }
+		void signal() { semaphore_signal(&sem); }
+	};
+#endif
 
 class lock
 {