Debian Codegraph @

build/future_function_templates/future.h.template

raw
1 #ifndef FUTURE_H
2 #define FUTURE_H
3
4 #include <bson/bson.h>
5
6 #include "mock_server/future-value.h"
7 #include <mongoc/mongoc-thread-private.h>
8
9 {{ header_comment }}
10
11 typedef struct
12 {
13 bool resolved;
14 bool awaited;
15 future_value_t return_value;
16 int argc;
17 future_value_t *argv;
18 mongoc_cond_t cond;
19 bson_mutex_t mutex;
20 bson_thread_t thread;
21 } future_t;
22
23 future_t *future_new (future_value_type_t return_type, int argc);
24
25 future_value_t *future_get_param (future_t *future, int i);
26
27 void future_start (future_t *future,
28 BSON_THREAD_FUN_TYPE (start_routine));
29
30 void future_resolve (future_t *future, future_value_t return_value);
31
32 bool future_wait (future_t *future);
33 bool future_wait_max (future_t *future, int64_t timeout_ms);
34
35 void future_get_void (future_t *future);
36
37 {% for T in type_list %}
38 {{ T }}
39 future_get_{{ T }} (future_t *future);
40 {% endfor %}
41
42 void future_destroy (future_t *future);
43
44 #endif /* FUTURE_H */