Lines Matching refs:handle

31 void uv__async_endgame(uv_loop_t* loop, uv_async_t* handle) {  in uv__async_endgame()  argument
32 if (handle->flags & UV_HANDLE_CLOSING && in uv__async_endgame()
33 !handle->async_sent) { in uv__async_endgame()
34 assert(!(handle->flags & UV_HANDLE_CLOSED)); in uv__async_endgame()
35 uv__handle_close(handle); in uv__async_endgame()
40 int uv_async_init(uv_loop_t* loop, uv_async_t* handle, uv_async_cb async_cb) { in uv_async_init() argument
43 uv__handle_init(loop, (uv_handle_t*) handle, UV_ASYNC); in uv_async_init()
44 handle->async_sent = 0; in uv_async_init()
45 handle->async_cb = async_cb; in uv_async_init()
47 req = &handle->async_req; in uv_async_init()
49 req->data = handle; in uv_async_init()
51 uv__handle_start(handle); in uv_async_init()
57 void uv__async_close(uv_loop_t* loop, uv_async_t* handle) { in uv__async_close() argument
58 if (!((uv_async_t*)handle)->async_sent) { in uv__async_close()
59 uv__want_endgame(loop, (uv_handle_t*) handle); in uv__async_close()
62 uv__handle_closing(handle); in uv__async_close()
66 int uv_async_send(uv_async_t* handle) { in uv_async_send() argument
67 uv_loop_t* loop = handle->loop; in uv_async_send()
69 if (handle->type != UV_ASYNC) { in uv_async_send()
76 assert(!(handle->flags & UV_HANDLE_CLOSING)); in uv_async_send()
78 if (!uv__atomic_exchange_set(&handle->async_sent)) { in uv_async_send()
79 POST_COMPLETION_FOR_REQ(loop, &handle->async_req); in uv_async_send()
86 void uv__process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle, in uv__process_async_wakeup_req() argument
88 assert(handle->type == UV_ASYNC); in uv__process_async_wakeup_req()
91 handle->async_sent = 0; in uv__process_async_wakeup_req()
93 if (handle->flags & UV_HANDLE_CLOSING) { in uv__process_async_wakeup_req()
94 uv__want_endgame(loop, (uv_handle_t*)handle); in uv__process_async_wakeup_req()
95 } else if (handle->async_cb != NULL) { in uv__process_async_wakeup_req()
96 handle->async_cb(handle); in uv__process_async_wakeup_req()