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 CHECK(future != NULL); in future_ready()
64 CHECK(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 CHECK(future != NULL); in future_await()
75 if (future->semaphore) semaphore_wait(future->semaphore); in future_await()
77 void* result = future->result; in future_await()
78 future_free(future); in future_await()
82 static void future_free(future_t* future) { in future_free() argument
83 if (!future) return; in future_free()
85 semaphore_free(future->semaphore); in future_free()
86 osi_free(future); in future_free()