From 8e16f8e0564a7b853c2cb0f92572e7959c6cadae Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 26 May 2013 23:02:17 +0200 Subject: [PATCH] unix: add uv__is_closing() macro --- src/unix/core.c | 2 +- src/uv-common.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix/core.c b/src/unix/core.c index b7f0da38..61d72493 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -225,7 +225,7 @@ static void uv__run_closing_handles(uv_loop_t* loop) { int uv_is_closing(const uv_handle_t* handle) { - return handle->flags & (UV_CLOSING | UV_CLOSED); + return uv__is_closing(handle); } diff --git a/src/uv-common.h b/src/uv-common.h index 80c9c719..bbf24859 100644 --- a/src/uv-common.h +++ b/src/uv-common.h @@ -149,6 +149,9 @@ void uv__fs_poll_close(uv_fs_poll_t* handle); #define uv__is_active(h) \ (((h)->flags & UV__HANDLE_ACTIVE) != 0) +#define uv__is_closing(h) \ + (((h)->flags & (UV_CLOSING | UV_CLOSED)) != 0) + #define uv__handle_start(h) \ do { \ assert(((h)->flags & UV__HANDLE_CLOSING) == 0); \