-
Notifications
You must be signed in to change notification settings - Fork 0
/
reactor-internal.h
54 lines (42 loc) · 1.35 KB
/
reactor-internal.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: MIT
#ifndef IOUCONTEXT_REACTOR_INTERNAL_H
#define IOUCONTEXT_REACTOR_INTERNAL_H
#include "defortified_setjmp.h"
#include "reactor.h"
#include "jump_queue.h"
#include "timespec.h"
#include <liburing.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct reactor_stack_cache_s reactor_stack_cache_t;
typedef struct reactor_s {
struct io_uring ring;
jump_queue_t todos;
sigjmp_buf *runner;
stack_t stack;
reactor_stack_cache_t * stack_cache;
void *cookie;
reactor_cookie_eat_t cookie_eat;
int result;
unsigned sqes, cqes;
int reserved;
long int queue_depth;
fiber_t *current;
} reactor_t;
void reactor_enter_core(reactor_t *);
void reactor_promise(reactor_t *, struct io_uring_sqe *);
void reactor_promise_nonchalant(reactor_t *, struct io_uring_sqe *);
void reactor_promise_impatient(reactor_t *, struct io_uring_sqe *, struct timespec);
void reactor_future_fake(reactor_t *, struct io_uring_sqe *);
void reactor_schedule(reactor_t *, jump_chain_t *);
struct io_uring_sqe * reactor_sqe(reactor_t * reactor);
void reactor_reserve_sqes(reactor_t *, size_t);
unsigned reactor_inflight(const reactor_t *);
bool reactor_todos(const reactor_t *);
stack_t reactor_stack_get(reactor_t *);
void reactor_stack_put(reactor_t *, stack_t);
#ifdef __cplusplus
}
#endif
#endif//IOUCONTEXT_REACTOR_INTERNAL_H