about summary refs log tree commit diff
path: root/src/base/system.h
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2012-01-01 15:56:28 +0100
committerMagnus Auvinen <magnus.auvinen@gmail.com>2012-01-01 15:56:28 +0100
commite59b24d8db8a7a9ec21c654302d89e01903f4d96 (patch)
tree26b38372e28f3c440f73c00ba60325a6c910726a /src/base/system.h
parentc31c82a5840640b0c7f4b07eb90e681b88b0a330 (diff)
downloadzcatch-e59b24d8db8a7a9ec21c654302d89e01903f4d96.tar.gz
zcatch-e59b24d8db8a7a9ec21c654302d89e01903f4d96.zip
fixed atomics and semaphore for windows. can't test it correctly however due to that I only have a virtual box machine
Diffstat (limited to 'src/base/system.h')
-rw-r--r--src/base/system.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/base/system.h b/src/base/system.h
index aaa5b43f..ca93279f 100644
--- a/src/base/system.h
+++ b/src/base/system.h
@@ -388,6 +388,23 @@ int lock_try(LOCK lock);
 void lock_wait(LOCK lock);
 void lock_release(LOCK lock);
 
+
+/* Group: Semaphores */
+
+#if defined(CONF_FAMILY_UNIX)
+	#include <semaphore.h>
+	typedef sem_t SEMAPHORE;
+#elif defined(CONF_FAMILY_WINDOWS)
+	typedef void* SEMAPHORE;
+#else
+	#error missing sempahore implementation
+#endif
+
+void semaphore_init(SEMAPHORE *sem);
+void semaphore_wait(SEMAPHORE *sem);
+void semaphore_signal(SEMAPHORE *sem);
+void semaphore_destroy(SEMAPHORE *sem);
+
 /* Group: Timer */
 #ifdef __GNUC__
 /* if compiled with -pedantic-errors it will complain about long