From 899ebf2371c57004989b4a7d3feec9ed75c3d04b Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 16 May 2011 21:46:07 +0200 Subject: [PATCH] uv_is_active for *nix --- uv-unix.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/uv-unix.c b/uv-unix.c index 2bc54c33..d29ff08b 100644 --- a/uv-unix.c +++ b/uv-unix.c @@ -1046,6 +1046,19 @@ int uv_idle_stop(uv_handle_t* handle) { } +int uv_is_active(uv_handle_t* handle) { + switch (handle->type) { + case UV_PREPARE: + case UV_CHECK: + case UV_IDLE: + return ev_is_active(handle); + + default: + return 1; + } +} + + static void uv__async(EV_P_ ev_async* w, int revents) { uv_handle_t* handle = (uv_handle_t*)(w->data);