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;
66 const SEM_FAILED = cast(sem_t*) null;
69 int sem_close(sem_t*);
70 int sem_destroy(sem_t*);
71 int sem_getvalue(sem_t*, int*);
72 int sem_init(sem_t*, int, uint);
73 sem_t* sem_open(in char*, int, ...);
75 int sem_trywait(sem_t*);
76 int sem_unlink(in char*);
83 int sem_timedwait(sem_t*, in timespec*);
88 int sem_timedwait(sem_t*, in timespec*);
90 else version( darwin )
92 int sem_timedwait(sem_t*, in timespec*);
94 else version( freebsd )
96 int sem_timedwait(sem_t*, in timespec*);