diff options
author | Bert Belder <bertbelder@gmail.com> | 2012-08-28 02:43:55 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-08-28 02:44:36 +0200 |
commit | 4822d780bb913c9ef7c2301a181a5834887cddb4 (patch) | |
tree | 646645a4d2901ff2209edd1a24683dff22496862 /deps/uv/src/uv-common.h | |
parent | 985e3a25cb93f82dbef9b1b4279b8614f508898c (diff) | |
download | android-node-v8-4822d780bb913c9ef7c2301a181a5834887cddb4.tar.gz android-node-v8-4822d780bb913c9ef7c2301a181a5834887cddb4.tar.bz2 android-node-v8-4822d780bb913c9ef7c2301a181a5834887cddb4.zip |
uv: upgrade to 621a4e3
Diffstat (limited to 'deps/uv/src/uv-common.h')
-rw-r--r-- | deps/uv/src/uv-common.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/deps/uv/src/uv-common.h b/deps/uv/src/uv-common.h index 4608ee549c..e9caed9af0 100644 --- a/deps/uv/src/uv-common.h +++ b/deps/uv/src/uv-common.h @@ -53,12 +53,14 @@ enum { UV__HANDLE_INTERNAL = 0x8000, UV__HANDLE_ACTIVE = 0x4000, - UV__HANDLE_REF = 0x2000 + UV__HANDLE_REF = 0x2000, + UV__HANDLE_CLOSING = 0 /* no-op on unix */ }; #else # define UV__HANDLE_INTERNAL 0x80 # define UV__HANDLE_ACTIVE 0x40 # define UV__HANDLE_REF 0x20 +# define UV__HANDLE_CLOSING 0x01 #endif extern const uv_err_t uv_ok_; @@ -129,28 +131,32 @@ UNUSED static int uv__is_active(const uv_handle_t* h) { UNUSED static void uv__handle_start(uv_handle_t* h) { if (h->flags & UV__HANDLE_ACTIVE) return; - if (h->flags & UV__HANDLE_REF) uv__active_handle_add(h); h->flags |= UV__HANDLE_ACTIVE; + if (h->flags & UV__HANDLE_CLOSING) return; + if (h->flags & UV__HANDLE_REF) uv__active_handle_add(h); } #define uv__handle_start(h) uv__handle_start((uv_handle_t*)(h)) UNUSED static void uv__handle_stop(uv_handle_t* h) { if (!(h->flags & UV__HANDLE_ACTIVE)) return; - if (h->flags & UV__HANDLE_REF) uv__active_handle_rm(h); h->flags &= ~UV__HANDLE_ACTIVE; + if (h->flags & UV__HANDLE_CLOSING) return; + if (h->flags & UV__HANDLE_REF) uv__active_handle_rm(h); } #define uv__handle_stop(h) uv__handle_stop((uv_handle_t*)(h)) UNUSED static void uv__handle_ref(uv_handle_t* h) { if (h->flags & UV__HANDLE_REF) return; - if (h->flags & UV__HANDLE_ACTIVE) uv__active_handle_add(h); + if (h->flags & (UV__HANDLE_ACTIVE | UV__HANDLE_CLOSING)) + uv__active_handle_add(h); h->flags |= UV__HANDLE_REF; } #define uv__handle_ref(h) uv__handle_ref((uv_handle_t*)(h)) UNUSED static void uv__handle_unref(uv_handle_t* h) { if (!(h->flags & UV__HANDLE_REF)) return; - if (h->flags & UV__HANDLE_ACTIVE) uv__active_handle_rm(h); + if (h->flags & (UV__HANDLE_ACTIVE | UV__HANDLE_CLOSING)) + uv__active_handle_rm(h); h->flags &= ~UV__HANDLE_REF; } #define uv__handle_unref(h) uv__handle_unref((uv_handle_t*)(h)) |