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
|
#ifndef FUTURE_H
#define FUTURE_H
#include <bson/bson.h>
#include "future-value.h"
#include "mongoc/mongoc-thread-private.h"
{{ header_comment }}
typedef struct
{
bool resolved;
bool awaited;
future_value_t return_value;
int argc;
future_value_t *argv;
mongoc_cond_t cond;
bson_mutex_t mutex;
bson_thread_t thread;
} future_t;
future_t *future_new (future_value_type_t return_type, int argc);
future_value_t *future_get_param (future_t *future, int i);
void future_start (future_t *future,
void *(*start_routine)(void *));
void future_resolve (future_t *future, future_value_t return_value);
bool future_wait (future_t *future);
bool future_wait_max (future_t *future, int64_t timeout_ms);
void future_get_void (future_t *future);
{% for T in type_list %}
{{ T }}
future_get_{{ T }} (future_t *future);
{% endfor %}
void future_destroy (future_t *future);
#endif /* FUTURE_H */
|