aboutsummaryrefslogtreecommitdiff
path: root/include/bh/internal/thread_posix.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/bh/internal/thread_posix.h')
-rw-r--r--include/bh/internal/thread_posix.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/bh/internal/thread_posix.h b/include/bh/internal/thread_posix.h
index bef12a9..f02ce3a 100644
--- a/include/bh/internal/thread_posix.h
+++ b/include/bh/internal/thread_posix.h
@@ -1,4 +1,5 @@
#include <pthread.h>
+#include <semaphore.h>
struct bh_thread_s
{
@@ -11,6 +12,11 @@ struct bh_mutex_s
pthread_mutex_t handle;
};
+struct bh_semaphore_s
+{
+ sem_t handle;
+};
+
struct bh_cond_s
{
pthread_cond_t handle;
@@ -22,6 +28,10 @@ int bh_thread_init(bh_thread_t *thread,
int bh_mutex_init(bh_mutex_t *mutex);
void bh_mutex_destroy(bh_mutex_t *mutex);
+int bh_semaphore_init(bh_semaphore_t *semaphore,
+ int count);
+void bh_semaphore_destroy(bh_semaphore_t *semaphore);
+
int bh_cond_init(bh_cond_t *cond);
void bh_cond_destroy(bh_cond_t *cond);