aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/Posix/Thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform/Posix/Thread.h')
-rw-r--r--src/Platform/Posix/Thread.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Platform/Posix/Thread.h b/src/Platform/Posix/Thread.h
index 5cf48ed..84fb0af 100644
--- a/src/Platform/Posix/Thread.h
+++ b/src/Platform/Posix/Thread.h
@@ -3,8 +3,8 @@
#include <BH/Thread.h>
+#include <unistd.h>
#include <pthread.h>
-#include <semaphore.h>
struct BH_Condition
@@ -19,10 +19,22 @@ struct BH_Mutex
};
+#if (_POSIX_SEMAPHORES >= 200112L)
+#include <semaphore.h>
+
struct BH_Semaphore
{
sem_t handle;
};
+#else
+struct BH_Semaphore
+{
+ int count;
+ int waiters;
+ pthread_mutex_t mutex;
+ pthread_cond_t condition;
+};
+#endif
struct BH_Thread