STASIS
A pipeline delivery generator
Loading...
Searching...
No Matches
sem.h
Go to the documentation of this file.
1
4#ifndef STASIS_SEMAPHORE_H
5#define STASIS_SEMAPHORE_H
6
7#include "core.h"
8#include <semaphore.h>
9#if defined(STASIS_OS_DARWIN)
10// Darwin's sem_open() limits the path length to PSEMNAMLEN
11// even though it isn't used directly.
12#include <sys/posix_sem.h> // PSEMNAMLEN
13#endif
14
15struct Semaphore {
16 sem_t *sem;
17 char name[STASIS_NAME_MAX];
18};
19
57int semaphore_init(struct Semaphore *s, const char *name, int value);
58int semaphore_wait(struct Semaphore *s);
59int semaphore_post(struct Semaphore *s);
60void semaphore_destroy(struct Semaphore *s);
61
62#endif //STASIS_SEMAPHORE_H
int semaphore_init(struct Semaphore *s, const char *name, int value)
Definition semaphore.c:33
Definition sem.h:15