diff options
author | Saúl Ibarra Corretgé <saghul@gmail.com> | 2014-11-21 15:43:12 +0100 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-11-26 12:08:36 -0800 |
commit | 9d9ed61c5a97562b93a2326f33922783ed509d47 (patch) | |
tree | 702c9dcc3a54bcc7bad26b9b756ddada54795c02 /deps/uv/src/uv-common.c | |
parent | 2d17193f20930bfe594d7008fe5c08f813f03c7b (diff) | |
download | android-node-v8-9d9ed61c5a97562b93a2326f33922783ed509d47.tar.gz android-node-v8-9d9ed61c5a97562b93a2326f33922783ed509d47.tar.bz2 android-node-v8-9d9ed61c5a97562b93a2326f33922783ed509d47.zip |
deps: update libuv to 1.0.0
PR-URL: https://github.com/joyent/node/pull/8762
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'deps/uv/src/uv-common.c')
-rw-r--r-- | deps/uv/src/uv-common.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c index 97727baa54..5ba1ea4df4 100644 --- a/deps/uv/src/uv-common.c +++ b/deps/uv/src/uv-common.c @@ -257,64 +257,6 @@ int uv_udp_recv_stop(uv_udp_t* handle) { } -struct thread_ctx { - void (*entry)(void* arg); - void* arg; -}; - - -#ifdef _WIN32 -static UINT __stdcall uv__thread_start(void* arg) -#else -static void* uv__thread_start(void *arg) -#endif -{ - struct thread_ctx *ctx_p; - struct thread_ctx ctx; - - ctx_p = arg; - ctx = *ctx_p; - free(ctx_p); - ctx.entry(ctx.arg); - - return 0; -} - - -int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { - struct thread_ctx* ctx; - int err; - - ctx = malloc(sizeof(*ctx)); - if (ctx == NULL) - return UV_ENOMEM; - - ctx->entry = entry; - ctx->arg = arg; - -#ifdef _WIN32 - *tid = (HANDLE) _beginthreadex(NULL, 0, uv__thread_start, ctx, 0, NULL); - err = *tid ? 0 : errno; -#else - err = pthread_create(tid, NULL, uv__thread_start, ctx); -#endif - - if (err) - free(ctx); - - return err ? -1 : 0; -} - - -unsigned long uv_thread_self(void) { -#ifdef _WIN32 - return (unsigned long) GetCurrentThreadId(); -#else - return (unsigned long) pthread_self(); -#endif -} - - void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) { QUEUE* q; uv_handle_t* h; |