diff options
author | Saúl Ibarra Corretgé <saghul@gmail.com> | 2014-12-09 21:01:35 +0100 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-12-09 17:03:50 -0800 |
commit | 20a7088d9c62c43fedf9ab077fbbeae92c7e6617 (patch) | |
tree | cd62507bde03fff1e59de67338f2b406d2221bdd /deps/uv/src/unix/kqueue.c | |
parent | 4dc660e164417e0a1bc86eadd825b41d7abb053f (diff) | |
download | android-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.tar.gz android-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.tar.bz2 android-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.zip |
deps: update libuv to 1.0.2
PR-URL: https://github.com/joyent/node/pull/8847
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/kqueue.c')
-rw-r--r-- | deps/uv/src/unix/kqueue.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/deps/uv/src/unix/kqueue.c b/deps/uv/src/unix/kqueue.c index b4f9f5d840..aaadcd8419 100644 --- a/deps/uv/src/unix/kqueue.c +++ b/deps/uv/src/unix/kqueue.c @@ -55,9 +55,11 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { unsigned int nevents; unsigned int revents; QUEUE* q; + uv__io_t* w; + sigset_t* pset; + sigset_t set; uint64_t base; uint64_t diff; - uv__io_t* w; int filter; int fflags; int count; @@ -117,6 +119,13 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { w->events = w->pevents; } + pset = NULL; + if (loop->flags & UV_LOOP_BLOCK_SIGPROF) { + pset = &set; + sigemptyset(pset); + sigaddset(pset, SIGPROF); + } + assert(timeout >= -1); base = loop->time; count = 48; /* Benchmarks suggest this gives the best throughput. */ @@ -127,6 +136,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { spec.tv_nsec = (timeout % 1000) * 1000000; } + if (pset != NULL) + pthread_sigmask(SIG_BLOCK, pset, NULL); + nfds = kevent(loop->backend_fd, events, nevents, @@ -134,6 +146,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { ARRAY_SIZE(events), timeout == -1 ? NULL : &spec); + if (pset != NULL) + pthread_sigmask(SIG_UNBLOCK, pset, NULL); + /* Update loop->time unconditionally. It's tempting to skip the update when * timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the * operating system didn't reschedule our process while in the syscall. |