Lines Matching refs:future
36 static void future_free(future_t *future);
62 void future_ready(future_t *future, void *value) { in future_ready() argument
63 assert(future != NULL); in future_ready()
64 assert(future->ready_can_be_called); in future_ready()
66 future->ready_can_be_called = false; in future_ready()
67 future->result = value; in future_ready()
68 semaphore_post(future->semaphore); in future_ready()
71 void *future_await(future_t *future) { in future_await() argument
72 assert(future != NULL); in future_await()
75 if (future->semaphore) in future_await()
76 semaphore_wait(future->semaphore); in future_await()
78 void *result = future->result; in future_await()
79 future_free(future); in future_await()
83 static void future_free(future_t *future) { in future_free() argument
84 if (!future) in future_free()
87 semaphore_free(future->semaphore); in future_free()
88 osi_free(future); in future_free()