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); \