Lines Matching refs:future
36 static void future_free(future_t* future);
63 void future_ready(future_t* future, void* value) { in future_ready() argument
64 CHECK(future != NULL); in future_ready()
65 CHECK(future->ready_can_be_called); in future_ready()
67 future->ready_can_be_called = false; in future_ready()
68 future->result = value; in future_ready()
69 semaphore_post(future->semaphore); in future_ready()
72 void* future_await(future_t* future) { in future_await() argument
73 CHECK(future != NULL); in future_await()
76 if (future->semaphore) 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) return; in future_free()
86 semaphore_free(future->semaphore); in future_free()
87 osi_free(future); in future_free()