2021-10-13 18:26:05 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_THREAD_NATIVESEM_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_THREAD_NATIVESEM_H_
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @fileoverview native semaphore for implementation details
|
|
|
|
*/
|
|
|
|
|
2021-10-25 23:02:26 +00:00
|
|
|
typedef union cthread_sem_t {
|
2021-10-13 18:26:05 +00:00
|
|
|
struct {
|
|
|
|
uint64_t count;
|
|
|
|
} linux;
|
2021-10-25 23:02:26 +00:00
|
|
|
} cthread_sem_t;
|
2021-10-13 18:26:05 +00:00
|
|
|
|
|
|
|
struct timespec;
|
|
|
|
|
2021-10-25 23:02:26 +00:00
|
|
|
int cthread_sem_init(cthread_sem_t*, int);
|
|
|
|
int cthread_sem_destroy(cthread_sem_t*);
|
2021-10-13 18:26:05 +00:00
|
|
|
|
2021-10-25 23:02:26 +00:00
|
|
|
int cthread_sem_wait(cthread_sem_t*, int, const struct timespec*);
|
|
|
|
int cthread_sem_signal(cthread_sem_t*);
|
2021-10-13 18:26:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_THREAD_SELF_H_ */
|
|
|
|
|