summaryrefslogtreecommitdiff
path: root/semaphore.h
diff options
context:
space:
mode:
authorrpj <rpj>2001-06-07 08:27:44 +0000
committerrpj <rpj>2001-06-07 08:27:44 +0000
commitcde63164e7f952ed0980fe62877796b81f749310 (patch)
treeb20099e176283639e7a62f720e7c137d9c16fa8e /semaphore.h
parent544c9bdc635a5ce92418ee58e71cf54ba50a60a1 (diff)
* semaphore.h (sem_t): Is now an opaque pointer;
moved actual definition to implement.h. * implement.h (sem_t_): Move here from semaphore.h; was the definition of sem_t. * semaphore.c: Wherever necessary, changed use of sem from that of a pointer to a pointer-pointer; added extra checks for a valid sem_t; NULL sem_t when it is destroyed; added extra checks when creating and destroying sem_t elements in the NEED_SEM code branches; changed from using a pthread_mutex_t ((*sem)->mutex) to CRITICAL_SECTION ((*sem)->sem_lock_cs) in NEED_SEM branches for access serialisation.
Diffstat (limited to 'semaphore.h')
-rw-r--r--semaphore.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/semaphore.h b/semaphore.h
index bc66e35..3616b11 100644
--- a/semaphore.h
+++ b/semaphore.h
@@ -64,15 +64,8 @@ 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 */
+
+typedef sem_t_ * sem_t;
int sem_init (sem_t * sem,
int pshared,