-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsemaphore.h
More file actions
30 lines (23 loc) · 717 Bytes
/
Copy pathsemaphore.h
File metadata and controls
30 lines (23 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// SPDX-License-Identifier: MIT
#ifndef IOUCONTEXT_SEMAPHORE_H
#define IOUCONTEXT_SEMAPHORE_H
#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct reactor_s reactor_t;
struct timespec;
typedef uint32_t iou_semaphore_value_t;
typedef struct iou_semaphore_s {
_Atomic iou_semaphore_value_t value;
} iou_semaphore_t;
void iou_semaphore(iou_semaphore_t *, const iou_semaphore_value_t);
void iou_semaphore_wait(reactor_t *, iou_semaphore_t *);
bool iou_semaphore_time(reactor_t *, iou_semaphore_t *, const struct timespec delta);
void iou_semaphore_post(reactor_t *, iou_semaphore_t *);
#ifdef __cplusplus
}
#endif
#endif//IOUCONTEXT_SEMAPHORE_H