36 lines511 bytes
Newer
Older
-
+
commited
{line.log.rev}
on
9 months ago
37
1
#include "coroutine.h"
2
3
4
struct Task {
5
Future base;
6
Coroutine *cor;
7
Task_Entry entry;
8
void *param;
9
Future *awaiting_future;
Last week
10
void *cancel_value;
9 months ago
37
11
bool canceled;
Last week
12
bool cor_owned;
9 months ago
37
13
};
14
15
16
static inline bool Task_IsCanceled(
17
Task *tsk
18
){
19
return tsk->canceled;
20
}
21
22
Last week
23
static inline Coroutine_Err Task_Await(
9 months ago
37
24
Task *tsk,
25
void **res
26
){
27
return Future_Await(&tsk->base, res);
28
}
29
30
31
static inline Future *Task_GetAwaitedFuture(
32
Task *tsk
33
){
34
return tsk->awaiting_future;
35
}
36