Lines Matching refs:handle

29 void uv__loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle) {  in uv__loop_watcher_endgame()  argument
30 if (handle->flags & UV_HANDLE_CLOSING) { in uv__loop_watcher_endgame()
31 assert(!(handle->flags & UV_HANDLE_CLOSED)); in uv__loop_watcher_endgame()
32 handle->flags |= UV_HANDLE_CLOSED; in uv__loop_watcher_endgame()
33 uv__handle_close(handle); in uv__loop_watcher_endgame()
39 int uv_##name##_init(uv_loop_t* loop, uv_##name##_t* handle) { \
40 uv__handle_init(loop, (uv_handle_t*) handle, UV_##NAME); \
46 int uv_##name##_start(uv_##name##_t* handle, uv_##name##_cb cb) { \
47 uv_loop_t* loop = handle->loop; \
50 assert(handle->type == UV_##NAME); \
52 if (uv__is_active(handle)) \
60 handle->name##_next = old_head; \
61 handle->name##_prev = NULL; \
64 old_head->name##_prev = handle; \
67 loop->name##_handles = handle; \
69 handle->name##_cb = cb; \
70 uv__handle_start(handle); \
76 int uv_##name##_stop(uv_##name##_t* handle) { \
77 uv_loop_t* loop = handle->loop; \
79 assert(handle->type == UV_##NAME); \
81 if (!uv__is_active(handle)) \
85 if (loop->name##_handles == handle) { \
86 loop->name##_handles = handle->name##_next; \
90 if (loop->next_##name##_handle == handle) { \
91 loop->next_##name##_handle = handle->name##_next; \
94 if (handle->name##_prev) { \
95 handle->name##_prev->name##_next = handle->name##_next; \
97 if (handle->name##_next) { \
98 handle->name##_next->name##_prev = handle->name##_prev; \
101 uv__handle_stop(handle); \
108 uv_##name##_t* handle; \
113 handle = (loop)->next_##name##_handle; \
114 (loop)->next_##name##_handle = handle->name##_next; \
116 handle->name##_cb(handle); \