Skip to content

Commit 62dd1d7

Browse files
cjihrigMylesBorins
authored andcommitted
deps: upgrade to libuv 1.23.2
Backport-PR-URL: #24103 PR-URL: #23336 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Fixes: #23043 Fixes: #21773 Fixes: #16601 Fixes: #22999 Fixes: #23219 Fixes: #23066 Fixes: #23067 Fixes: #23089
1 parent dbc7d9b commit 62dd1d7

29 files changed

+558
-284
lines changed

deps/uv/AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,4 @@ Jeremiah Senkpiel <[email protected]>
351351
Andy Zhang <[email protected]>
352352
353353
Ryan Liptak <[email protected]>
354+
Ali Ijaz Sheikh <[email protected]>

deps/uv/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ if(WIN32)
193193
src/win/poll.c
194194
src/win/process.c
195195
src/win/process-stdio.c
196-
src/win/req.c
197196
src/win/signal.c
198197
src/win/snprintf.c
199198
src/win/stream.c

deps/uv/ChangeLog

+38
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
2018.10.09, Version 1.23.2 (Stable), 34c12788d2e7308f3ac506c0abcbf74c0d6abd20
2+
3+
Changes since version 1.23.1:
4+
5+
* unix: return 0 retrieving rss on cygwin (cjihrig)
6+
7+
* unix: initialize uv_interface_address_t.phys_addr (cjihrig)
8+
9+
* test: handle uv_os_setpriority() windows edge case (cjihrig)
10+
11+
* tty, win: fix read stop for raw mode (Bartosz Sosnowski)
12+
13+
* Revert "Revert "unix,fs: fix for potential partial reads/writes"" (Jameson
14+
Nash)
15+
16+
* unix,readv: always permit partial reads to return (Jameson Nash)
17+
18+
* win,tty: fix uv_tty_close() (Bartosz Sosnowski)
19+
20+
* doc: remove extraneous "on" (Ben Noordhuis)
21+
22+
* unix,win: fix threadpool race condition (Anna Henningsen)
23+
24+
* unix: rework thread barrier implementation (Ben Noordhuis)
25+
26+
* aix: switch to libuv's own thread barrier impl (Ben Noordhuis)
27+
28+
* unix: signal done to last thread barrier waiter (Ben Noordhuis)
29+
30+
* test: add uv_barrier_wait serial thread test (Ali Ijaz Sheikh)
31+
32+
* unix: optimize uv_fs_readlink() memory allocation (Ben Noordhuis)
33+
34+
* win: remove req.c and other cleanup (Carlo Marcelo Arenas Belón)
35+
36+
* aix: don't EISDIR on read from directory fd (Ben Noordhuis)
37+
38+
139
2018.09.22, Version 1.23.1 (Stable), d2282b3d67821dc53c907c2155fa8c5c6ce25180
240

341
Changes since version 1.23.0:

deps/uv/Makefile.am

+2-6
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ libuv_la_SOURCES += src/win/async.c \
6868
src/win/poll.c \
6969
src/win/process-stdio.c \
7070
src/win/process.c \
71-
src/win/req.c \
7271
src/win/req-inl.h \
7372
src/win/signal.c \
7473
src/win/stream.c \
@@ -340,8 +339,7 @@ libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c
340339
endif
341340

342341
if ANDROID
343-
uvinclude_HEADERS += include/uv/android-ifaddrs.h \
344-
include/uv/pthread-barrier.h
342+
uvinclude_HEADERS += include/uv/android-ifaddrs.h
345343
libuv_la_SOURCES += src/unix/android-ifaddrs.c \
346344
src/unix/pthread-fixes.c
347345
endif
@@ -361,8 +359,7 @@ libuv_la_SOURCES += src/unix/cygwin.c \
361359
endif
362360

363361
if DARWIN
364-
uvinclude_HEADERS += include/uv/darwin.h \
365-
include/uv/pthread-barrier.h
362+
uvinclude_HEADERS += include/uv/darwin.h
366363
libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
367364
libuv_la_CFLAGS += -D_DARWIN_UNLIMITED_SELECT=1
368365
libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
@@ -445,7 +442,6 @@ libuv_la_SOURCES += src/unix/no-proctitle.c \
445442
endif
446443

447444
if OS390
448-
uvinclude_HEADERS += include/uv/pthread-barrier.h
449445
libuv_la_CFLAGS += -D_UNIX03_THREADS \
450446
-D_UNIX03_SOURCE \
451447
-D_OPEN_SYS_IF_EXT=1 \

deps/uv/configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414

1515
AC_PREREQ(2.57)
16-
AC_INIT([libuv], [1.23.1], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.23.2], [https://github.com/libuv/libuv/issues])
1717
AC_CONFIG_MACRO_DIR([m4])
1818
m4_include([m4/libuv-extra-automake-flags.m4])
1919
m4_include([m4/as_case.m4])

deps/uv/docs/src/design.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ so the current approach is to run blocking file I/O operations in a thread pool.
126126
For a thorough explanation of the cross-platform file I/O landscape, checkout
127127
`this post <http://blog.libtorrent.org/2012/10/asynchronous-disk-io/>`_.
128128

129-
libuv currently uses a global thread pool on which all loops can queue work on. 3 types of
129+
libuv currently uses a global thread pool on which all loops can queue work. 3 types of
130130
operations are currently run on this pool:
131131

132132
* File system operations

deps/uv/include/uv/pthread-barrier.h

-69
This file was deleted.

deps/uv/include/uv/unix.h

+21-5
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@
6666
# include "uv/posix.h"
6767
#endif
6868

69-
#ifndef PTHREAD_BARRIER_SERIAL_THREAD
70-
# include "uv/pthread-barrier.h"
71-
#endif
72-
7369
#ifndef NI_MAXHOST
7470
# define NI_MAXHOST 1025
7571
#endif
@@ -136,8 +132,28 @@ typedef pthread_rwlock_t uv_rwlock_t;
136132
typedef UV_PLATFORM_SEM_T uv_sem_t;
137133
typedef pthread_cond_t uv_cond_t;
138134
typedef pthread_key_t uv_key_t;
139-
typedef pthread_barrier_t uv_barrier_t;
140135

136+
/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */
137+
#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
138+
/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */
139+
struct _uv_barrier {
140+
uv_mutex_t mutex;
141+
uv_cond_t cond;
142+
unsigned threshold;
143+
unsigned in;
144+
unsigned out;
145+
};
146+
147+
typedef struct {
148+
struct _uv_barrier* b;
149+
# if defined(PTHREAD_BARRIER_SERIAL_THREAD)
150+
/* TODO(bnoordhuis) Remove padding in v2. */
151+
char pad[sizeof(pthread_barrier_t) - sizeof(struct _uv_barrier*)];
152+
# endif
153+
} uv_barrier_t;
154+
#else
155+
typedef pthread_barrier_t uv_barrier_t;
156+
#endif
141157

142158
/* Platform-specific definitions for uv_spawn support. */
143159
typedef gid_t uv_gid_t;

deps/uv/include/uv/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#define UV_VERSION_MAJOR 1
3434
#define UV_VERSION_MINOR 23
35-
#define UV_VERSION_PATCH 1
35+
#define UV_VERSION_PATCH 2
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

deps/uv/src/threadpool.c

+12-6
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ static void worker(void* arg) {
6262
uv_sem_post((uv_sem_t*) arg);
6363
arg = NULL;
6464

65+
uv_mutex_lock(&mutex);
6566
for (;;) {
66-
uv_mutex_lock(&mutex);
67+
/* `mutex` should always be locked at this point. */
6768

68-
wait_for_work:
6969
/* Keep waiting while either no work is present or only slow I/O
7070
and we're at the threshold for that. */
7171
while (QUEUE_EMPTY(&wq) ||
@@ -93,13 +93,13 @@ static void worker(void* arg) {
9393
other work in the queue is done. */
9494
if (slow_io_work_running >= slow_work_thread_threshold()) {
9595
QUEUE_INSERT_TAIL(&wq, q);
96-
goto wait_for_work;
96+
continue;
9797
}
9898

9999
/* If we encountered a request to run slow I/O work but there is none
100100
to run, that means it's cancelled => Start over. */
101101
if (QUEUE_EMPTY(&slow_io_pending_wq))
102-
goto wait_for_work;
102+
continue;
103103

104104
is_slow_work = 1;
105105
slow_io_work_running++;
@@ -122,13 +122,19 @@ static void worker(void* arg) {
122122
w->work(w);
123123

124124
uv_mutex_lock(&w->loop->wq_mutex);
125-
if (is_slow_work)
126-
slow_io_work_running--;
127125
w->work = NULL; /* Signal uv_cancel() that the work req is done
128126
executing. */
129127
QUEUE_INSERT_TAIL(&w->loop->wq, &w->wq);
130128
uv_async_send(&w->loop->wq_async);
131129
uv_mutex_unlock(&w->loop->wq_mutex);
130+
131+
/* Lock `mutex` since that is expected at the start of the next
132+
* iteration. */
133+
uv_mutex_lock(&mutex);
134+
if (is_slow_work) {
135+
/* `slow_io_work_running` is protected by `mutex`. */
136+
slow_io_work_running--;
137+
}
132138
}
133139
}
134140

deps/uv/src/unix/bsd-ifaddrs.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,13 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
119119
continue;
120120

121121
address = *addresses;
122+
memset(address->phys_addr, 0, sizeof(address->phys_addr));
122123

123124
for (i = 0; i < *count; i++) {
124125
if (strcmp(address->name, ent->ifa_name) == 0) {
125-
#if defined(__CYGWIN__) || defined(__MSYS__)
126-
memset(address->phys_addr, 0, sizeof(address->phys_addr));
127-
#else
128126
struct sockaddr_dl* sa_addr;
129127
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
130128
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
131-
#endif
132129
}
133130
address++;
134131
}

deps/uv/src/unix/cygwin.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int uv_uptime(double* uptime) {
3838
int uv_resident_set_memory(size_t* rss) {
3939
/* FIXME: read /proc/meminfo? */
4040
*rss = 0;
41-
return UV_ENOSYS;
41+
return 0;
4242
}
4343

4444
int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {

0 commit comments

Comments
 (0)