STASIS
A pipeline delivery generator
Loading...
Searching...
No Matches
src
lib
core
include
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
15
struct
Semaphore
{
16
sem_t *sem;
17
char
name[STASIS_NAME_MAX];
18
};
19
57
int
semaphore_init
(
struct
Semaphore
*s,
const
char
*name,
int
value);
58
int
semaphore_wait(
struct
Semaphore
*s);
59
int
semaphore_post(
struct
Semaphore
*s);
60
void
semaphore_destroy(
struct
Semaphore
*s);
61
62
#endif
//STASIS_SEMAPHORE_H
core.h
semaphore_init
int semaphore_init(struct Semaphore *s, const char *name, int value)
Definition
semaphore.c:33
Semaphore
Definition
sem.h:15
Generated by
1.13.2