Skip to content

Commit b68c8df

Browse files
saghulmscdex
authored andcommitted
deps: update libuv to 0.10.30
PR-URL: nodejs#8849 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
1 parent 32f4afa commit b68c8df

File tree

18 files changed

+172
-33
lines changed

18 files changed

+172
-33
lines changed

deps/uv/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,4 @@ Paul Tan <pyokagan@gmail.com>
131131
Javier Hernández <jhernandez@emergya.com>
132132
Tonis Tiigi <tonistiigi@gmail.com>
133133
Michael Hudson-Doyle <michael.hudson@linaro.org>
134+
Helge Deller <deller@gmx.de>

deps/uv/ChangeLog

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
2014.10.21, Version 0.10.29 (Stable)
1+
2014.12.10, Version 0.10.30 (Stable)
2+
3+
Changes since version 0.10.29:
4+
5+
* linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis)
6+
7+
* linux: handle O_NONBLOCK != SOCK_NONBLOCK case (Helge Deller)
8+
9+
* doc: update project links (Ben Noordhuis)
10+
11+
* windows: fix compilation of tests (Marc Schlaich)
12+
13+
* unix: add flag for blocking SIGPROF during poll (Ben Noordhuis)
14+
15+
* unix, windows: add uv_loop_configure() function (Ben Noordhuis)
16+
17+
* win: keep a reference to AFD_POLL_INFO in cancel poll (Marc Schlaich)
18+
19+
20+
2014.10.21, Version 0.10.29 (Stable), 2d728542d3790183417f8f122a110693cd85db14
221

322
Changes since version 0.10.28:
423

deps/uv/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ http://nodejs.org/
4242

4343
## Documentation
4444

45-
* [include/uv.h](https://github.com/joyent/libuv/blob/master/include/uv.h)
45+
* [include/uv.h](https://github.com/libuv/libuv/blob/master/include/uv.h)
4646
&mdash; API documentation in the form of detailed header comments.
4747
* [An Introduction to libuv](http://nikhilm.github.com/uvbook/) &mdash; An
4848
overview of libuv with tutorials.
4949
* [LXJS 2012 talk](http://www.youtube.com/watch?v=nGn60vDSxQ4) - High-level
5050
introductory talk about libuv.
51-
* [Tests and benchmarks](https://github.com/joyent/libuv/tree/master/test) -
51+
* [Tests and benchmarks](https://github.com/libuv/libuv/tree/master/test) -
5252
API specification and usage examples.
5353

5454
## Build Instructions

deps/uv/include/uv-private/uv-win.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,10 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
474474
/* Used in fast mode */ \
475475
SOCKET peer_socket; \
476476
AFD_POLL_INFO afd_poll_info_1; \
477-
AFD_POLL_INFO afd_poll_info_2; \
477+
union { \
478+
AFD_POLL_INFO* afd_poll_info_ptr; \
479+
AFD_POLL_INFO afd_poll_info; \
480+
} afd_poll_info_2; \
478481
/* Used in fast and slow mode. */ \
479482
uv_req_t poll_req_1; \
480483
uv_req_t poll_req_2; \

deps/uv/include/uv.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ typedef struct uv_work_s uv_work_t;
226226
typedef struct uv_cpu_info_s uv_cpu_info_t;
227227
typedef struct uv_interface_address_s uv_interface_address_t;
228228

229+
typedef enum {
230+
/* Block a signal when polling for new events. The second argument to
231+
* uv_loop_configure() is the signal number.
232+
*
233+
* This operation is currently only implemented for SIGPROF signals,
234+
* to suppress unnecessary wakeups when using a sampling profiler.
235+
* Requesting other signals will fail with UV_EINVAL.
236+
*/
237+
UV_LOOP_BLOCK_SIGNAL
238+
} uv_loop_option;
229239

230240
typedef enum {
231241
UV_RUN_DEFAULT = 0,
@@ -264,6 +274,15 @@ UV_EXTERN void uv_loop_delete(uv_loop_t*);
264274
*/
265275
UV_EXTERN uv_loop_t* uv_default_loop(void);
266276

277+
/*
278+
* Set additional loop options. You should normally call this before the
279+
* first call to uv_run() unless mentioned otherwise.
280+
*
281+
* Returns 0 on success or a UV_E* error code on failure. Be prepared to
282+
* handle UV_ENOSYS; it means the loop option is not supported by the platform.
283+
*/
284+
UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...);
285+
267286
/*
268287
* This function runs the event loop. It will act differently depending on the
269288
* specified mode:

deps/uv/src/unix/internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ enum {
111111
UV_TCP_SINGLE_ACCEPT = 0x400 /* Only accept() when idle. */
112112
};
113113

114+
/* loop flags */
115+
enum {
116+
UV_LOOP_BLOCK_SIGPROF = 1
117+
};
118+
114119
/* core */
115120
int uv__nonblock(int fd, int set);
116121
int uv__cloexec(int fd, int set);

deps/uv/src/unix/kqueue.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
5656
unsigned int nevents;
5757
unsigned int revents;
5858
ngx_queue_t* q;
59+
uv__io_t* w;
60+
sigset_t* pset;
61+
sigset_t set;
5962
uint64_t base;
6063
uint64_t diff;
61-
uv__io_t* w;
6264
int filter;
6365
int fflags;
6466
int count;
@@ -118,6 +120,13 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
118120
w->events = w->pevents;
119121
}
120122

123+
pset = NULL;
124+
if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
125+
pset = &set;
126+
sigemptyset(pset);
127+
sigaddset(pset, SIGPROF);
128+
}
129+
121130
assert(timeout >= -1);
122131
base = loop->time;
123132
count = 48; /* Benchmarks suggest this gives the best throughput. */
@@ -128,13 +137,19 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
128137
spec.tv_nsec = (timeout % 1000) * 1000000;
129138
}
130139

140+
if (pset != NULL)
141+
pthread_sigmask(SIG_BLOCK, pset, NULL);
142+
131143
nfds = kevent(loop->backend_fd,
132144
events,
133145
nevents,
134146
events,
135147
ARRAY_SIZE(events),
136148
timeout == -1 ? NULL : &spec);
137149

150+
if (pset != NULL)
151+
pthread_sigmask(SIG_UNBLOCK, pset, NULL);
152+
138153
/* Update loop->time unconditionally. It's tempting to skip the update when
139154
* timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the
140155
* operating system didn't reschedule our process while in the syscall.

deps/uv/src/unix/linux-core.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <sys/prctl.h>
3434
#include <sys/sysinfo.h>
3535
#include <unistd.h>
36+
#include <signal.h>
3637
#include <fcntl.h>
3738
#include <time.h>
3839

@@ -130,6 +131,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
130131
struct uv__epoll_event e;
131132
ngx_queue_t* q;
132133
uv__io_t* w;
134+
sigset_t* pset;
135+
sigset_t set;
133136
uint64_t base;
134137
uint64_t diff;
135138
int nevents;
@@ -180,12 +183,25 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
180183
w->events = w->pevents;
181184
}
182185

186+
pset = NULL;
187+
if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
188+
pset = &set;
189+
sigemptyset(pset);
190+
sigaddset(pset, SIGPROF);
191+
}
192+
183193
assert(timeout >= -1);
184194
base = loop->time;
185195
count = 48; /* Benchmarks suggest this gives the best throughput. */
186196

187197
for (;;) {
188-
if (!no_epoll_wait) {
198+
if (no_epoll_wait || pset != NULL) {
199+
nfds = uv__epoll_pwait(loop->backend_fd,
200+
events,
201+
ARRAY_SIZE(events),
202+
timeout,
203+
pset);
204+
} else {
189205
nfds = uv__epoll_wait(loop->backend_fd,
190206
events,
191207
ARRAY_SIZE(events),
@@ -194,12 +210,6 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
194210
no_epoll_wait = 1;
195211
continue;
196212
}
197-
} else {
198-
nfds = uv__epoll_pwait(loop->backend_fd,
199-
events,
200-
ARRAY_SIZE(events),
201-
timeout,
202-
NULL);
203213
}
204214

205215
/* Update loop->time unconditionally. It's tempting to skip the update when

deps/uv/src/unix/linux-syscalls.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "linux-syscalls.h"
2323
#include <unistd.h>
24+
#include <signal.h>
2425
#include <sys/syscall.h>
2526
#include <sys/types.h>
2627
#include <errno.h>
@@ -298,7 +299,7 @@ int uv__epoll_pwait(int epfd,
298299
nevents,
299300
timeout,
300301
sigmask,
301-
sizeof(*sigmask));
302+
_NSIG / 8);
302303
#else
303304
return errno = ENOSYS, -1;
304305
#endif

deps/uv/src/unix/linux-syscalls.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#if defined(__alpha__)
4444
# define UV__O_NONBLOCK 0x4
4545
#elif defined(__hppa__)
46-
# define UV__O_NONBLOCK 0x10004
46+
# define UV__O_NONBLOCK O_NONBLOCK
4747
#elif defined(__mips__)
4848
# define UV__O_NONBLOCK 0x80
4949
#elif defined(__sparc__)
@@ -59,7 +59,11 @@
5959
#define UV__IN_NONBLOCK UV__O_NONBLOCK
6060

6161
#define UV__SOCK_CLOEXEC UV__O_CLOEXEC
62-
#define UV__SOCK_NONBLOCK UV__O_NONBLOCK
62+
#if defined(SOCK_NONBLOCK)
63+
# define UV__SOCK_NONBLOCK SOCK_NONBLOCK
64+
#else
65+
# define UV__SOCK_NONBLOCK UV__O_NONBLOCK
66+
#endif
6367

6468
/* epoll flags */
6569
#define UV__EPOLL_CLOEXEC UV__O_CLOEXEC

0 commit comments

Comments
 (0)