summaryrefslogtreecommitdiff
path: root/semaphore.h
diff options
context:
space:
mode:
Diffstat (limited to 'semaphore.h')
-rw-r--r--semaphore.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/semaphore.h b/semaphore.h
index fb475a0..8af8be8 100644
--- a/semaphore.h
+++ b/semaphore.h
@@ -28,8 +28,11 @@
#if !defined( SEMAPHORE_H )
#define SEMAPHORE_H
-#include <process.h>
+#ifdef NEED_ERRNO
+#include "need_errno.h"
+#else
#include <errno.h>
+#endif
#define _POSIX_SEMAPHORES
@@ -42,7 +45,15 @@ extern "C"
typedef unsigned int mode_t;
#endif
+#ifdef NEED_SEM
+typedef struct {
+ unsigned int value;
+ pthread_mutex_t mutex;
+ HANDLE event;
+} sem_t;
+#else /* NEED_SEM */
typedef HANDLE sem_t;
+#endif /* NEED_SEM */
int sem_init (sem_t * sem,
int pshared,