static void uv__run_pending(uv_loop_t* loop) { uv_handle_t* p; uv_handle_t* q; if (!loop->pending_handles) return; for (p = loop->pending_handles, loop->pending_handles = NULL; p; p = q) { q = p->next_pending; p->next_pending = NULL; p->flags &= ~UV__PENDING; if (p->flags & UV_CLOSING) { uv__finish_close(p); continue; } switch (p->type) { case UV_NAMED_PIPE: case UV_TCP: case UV_TTY: uv__stream_pending((uv_stream_t*)p); break; default: abort(); } } }
void uv__next(EV_P_ ev_idle* w, int revents) { uv_handle_t* handle = container_of(w, uv_handle_t, next_watcher); assert(revents == EV_IDLE); /* For now this function is only to handle the closing event, but we might * put more stuff here later. */ assert(handle->flags & UV_CLOSING); uv__finish_close(handle); }
void uv__next(EV_P_ ev_idle* watcher, int revents) { uv_handle_t* handle = watcher->data; assert(watcher == &handle->next_watcher); assert(revents == EV_IDLE); /* For now this function is only to handle the closing event, but we might * put more stuff here later. */ assert(uv_flag_is_set(handle, UV_CLOSING)); uv__finish_close(handle); }
static void uv__run_closing_handles(uv_loop_t* loop) { uv_handle_t* p; uv_handle_t* q; p = loop->closing_handles; loop->closing_handles = NULL; while (p) { q = p->next_closing; uv__finish_close(p); p = q; } }