2 * D header file for POSIX.
4 * Copyright: Public Domain
5 * License: Public Domain
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
9 module stdc.posix.semaphore;
11 private import stdc.posix.config;
12 private import stdc.posix.time;
23 int sem_close(sem_t*);
24 int sem_destroy(sem_t*);
25 int sem_getvalue(sem_t*, int*);
26 int sem_init(sem_t*, int, uint);
27 sem_t* sem_open(in char*, int, ...);
29 int sem_trywait(sem_t*);
30 int sem_unlink(in char*);
36 private alias int __atomic_lock_t;
38 private struct _pthread_fastlock
41 __atomic_lock_t __spinlock;
46 _pthread_fastlock __sem_lock;
51 const SEM_FAILED = cast(sem_t*) null;
53 else version( darwin )
57 const SEM_FAILED = cast(sem_t*) null;
59 else version( freebsd )
61 const uint SEM_MAGIC = 0x09fa4012;
67 pthread_cond_t gtzero;
81 const SEM_FAILED = cast(sem_t*) null;
84 int sem_close(sem_t*);
85 int sem_destroy(sem_t*);
86 int sem_getvalue(sem_t*, int*);
87 int sem_init(sem_t*, int, uint);
88 sem_t* sem_open(in char*, int, ...);
90 int sem_trywait(sem_t*);
91 int sem_unlink(in char*);
98 int sem_timedwait(sem_t*, in timespec*);
103 int sem_timedwait(sem_t*, in timespec*);
105 else version( darwin )
107 int sem_timedwait(sem_t*, in timespec*);
109 else version( freebsd )
111 int sem_timedwait(sem_t*, in timespec*);