| 1 | /* @title: IO waiting primitives */ |
|---|---|
| 2 | #pragma once |
| 3 | |
| 4 | /* NOTE: This file is now ARCHIVED. No one is suppose to go and start |
| 5 | * using this, but I'm keeping it here simply as reference */ |
| 6 | #include <thread/wait.h> |
| 7 | |
| 8 | struct io_wait_token { |
| 9 | struct thread_wait_block block; |
| 10 | struct list_node list; |
| 11 | bool active; |
| 12 | }; |
| 13 | |
| 14 | enum io_wait_end_action { |
| 15 | IO_WAIT_END_YIELD, |
| 16 | IO_WAIT_END_NO_OP, |
| 17 | }; |
| 18 | |
| 19 | #define IO_WAIT_TOKEN_EMPTY ((struct io_wait_token) {0}) |
| 20 | |
| 21 | void io_wait_begin(struct io_wait_token *out, |
| 22 | struct thread_wait_header *request) cc_deprecated; |
| 23 | |
| 24 | void io_wait_end(struct io_wait_token *t, enum io_wait_end_action act) |
| 25 | cc_deprecated; |
| 26 | |
| 27 | void io_wait_complete(struct io_wait_token *t) cc_deprecated; |
| 28 | |
| 29 | void io_wait_signal(struct thread_wait_header *request) cc_deprecated; |
| 30 | |
| 31 | static inline bool io_wait_token_active(struct io_wait_token *t) { |
| 32 | return t->active; |
| 33 | } |
| 34 |