Skip to content

Commit

Permalink
deps: upgrade to libuv 1.23.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed Oct 8, 2018
1 parent 0ad8c73 commit 8d645ef
Show file tree
Hide file tree
Showing 29 changed files with 558 additions and 284 deletions.
1 change: 1 addition & 0 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,4 @@ Jeremiah Senkpiel <fishrock123@rocketmail.com>
Andy Zhang <zhangyong232@gmail.com>
dmabupt <dmabupt@gmail.com>
Ryan Liptak <squeek502@hotmail.com>
Ali Ijaz Sheikh <ofrobots@google.com>
1 change: 0 additions & 1 deletion deps/uv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ if(WIN32)
src/win/poll.c
src/win/process.c
src/win/process-stdio.c
src/win/req.c
src/win/signal.c
src/win/snprintf.c
src/win/stream.c
Expand Down
38 changes: 38 additions & 0 deletions deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
2018.10.09, Version 1.23.2 (Stable), 34c12788d2e7308f3ac506c0abcbf74c0d6abd20

Changes since version 1.23.1:

* unix: return 0 retrieving rss on cygwin (cjihrig)

* unix: initialize uv_interface_address_t.phys_addr (cjihrig)

* test: handle uv_os_setpriority() windows edge case (cjihrig)

* tty, win: fix read stop for raw mode (Bartosz Sosnowski)

* Revert "Revert "unix,fs: fix for potential partial reads/writes"" (Jameson
Nash)

* unix,readv: always permit partial reads to return (Jameson Nash)

* win,tty: fix uv_tty_close() (Bartosz Sosnowski)

* doc: remove extraneous "on" (Ben Noordhuis)

* unix,win: fix threadpool race condition (Anna Henningsen)

* unix: rework thread barrier implementation (Ben Noordhuis)

* aix: switch to libuv's own thread barrier impl (Ben Noordhuis)

* unix: signal done to last thread barrier waiter (Ben Noordhuis)

* test: add uv_barrier_wait serial thread test (Ali Ijaz Sheikh)

* unix: optimize uv_fs_readlink() memory allocation (Ben Noordhuis)

* win: remove req.c and other cleanup (Carlo Marcelo Arenas Belón)

* aix: don't EISDIR on read from directory fd (Ben Noordhuis)


2018.09.22, Version 1.23.1 (Stable), d2282b3d67821dc53c907c2155fa8c5c6ce25180

Changes since version 1.23.0:
Expand Down
8 changes: 2 additions & 6 deletions deps/uv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ libuv_la_SOURCES += src/win/async.c \
src/win/poll.c \
src/win/process-stdio.c \
src/win/process.c \
src/win/req.c \
src/win/req-inl.h \
src/win/signal.c \
src/win/stream.c \
Expand Down Expand Up @@ -340,8 +339,7 @@ libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c
endif

if ANDROID
uvinclude_HEADERS += include/uv/android-ifaddrs.h \
include/uv/pthread-barrier.h
uvinclude_HEADERS += include/uv/android-ifaddrs.h
libuv_la_SOURCES += src/unix/android-ifaddrs.c \
src/unix/pthread-fixes.c
endif
Expand All @@ -361,8 +359,7 @@ libuv_la_SOURCES += src/unix/cygwin.c \
endif

if DARWIN
uvinclude_HEADERS += include/uv/darwin.h \
include/uv/pthread-barrier.h
uvinclude_HEADERS += include/uv/darwin.h
libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
libuv_la_CFLAGS += -D_DARWIN_UNLIMITED_SELECT=1
libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
Expand Down Expand Up @@ -445,7 +442,6 @@ libuv_la_SOURCES += src/unix/no-proctitle.c \
endif

if OS390
uvinclude_HEADERS += include/uv/pthread-barrier.h
libuv_la_CFLAGS += -D_UNIX03_THREADS \
-D_UNIX03_SOURCE \
-D_OPEN_SYS_IF_EXT=1 \
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.23.1], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.23.2], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/docs/src/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ so the current approach is to run blocking file I/O operations in a thread pool.
For a thorough explanation of the cross-platform file I/O landscape, checkout
`this post <http://blog.libtorrent.org/2012/10/asynchronous-disk-io/>`_.

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

* File system operations
Expand Down
69 changes: 0 additions & 69 deletions deps/uv/include/uv/pthread-barrier.h

This file was deleted.

26 changes: 21 additions & 5 deletions deps/uv/include/uv/unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@
# include "uv/posix.h"
#endif

#ifndef PTHREAD_BARRIER_SERIAL_THREAD
# include "uv/pthread-barrier.h"
#endif

#ifndef NI_MAXHOST
# define NI_MAXHOST 1025
#endif
Expand Down Expand Up @@ -136,8 +132,28 @@ typedef pthread_rwlock_t uv_rwlock_t;
typedef UV_PLATFORM_SEM_T uv_sem_t;
typedef pthread_cond_t uv_cond_t;
typedef pthread_key_t uv_key_t;
typedef pthread_barrier_t uv_barrier_t;

/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */
#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */
struct _uv_barrier {
uv_mutex_t mutex;
uv_cond_t cond;
unsigned threshold;
unsigned in;
unsigned out;
};

typedef struct {
struct _uv_barrier* b;
# if defined(PTHREAD_BARRIER_SERIAL_THREAD)
/* TODO(bnoordhuis) Remove padding in v2. */
char pad[sizeof(pthread_barrier_t) - sizeof(struct _uv_barrier*)];
# endif
} uv_barrier_t;
#else
typedef pthread_barrier_t uv_barrier_t;
#endif

/* Platform-specific definitions for uv_spawn support. */
typedef gid_t uv_gid_t;
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/include/uv/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 23
#define UV_VERSION_PATCH 1
#define UV_VERSION_PATCH 2
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""

Expand Down
18 changes: 12 additions & 6 deletions deps/uv/src/threadpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ static void worker(void* arg) {
uv_sem_post((uv_sem_t*) arg);
arg = NULL;

uv_mutex_lock(&mutex);
for (;;) {
uv_mutex_lock(&mutex);
/* `mutex` should always be locked at this point. */

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

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

is_slow_work = 1;
slow_io_work_running++;
Expand All @@ -122,13 +122,19 @@ static void worker(void* arg) {
w->work(w);

uv_mutex_lock(&w->loop->wq_mutex);
if (is_slow_work)
slow_io_work_running--;
w->work = NULL; /* Signal uv_cancel() that the work req is done
executing. */
QUEUE_INSERT_TAIL(&w->loop->wq, &w->wq);
uv_async_send(&w->loop->wq_async);
uv_mutex_unlock(&w->loop->wq_mutex);

/* Lock `mutex` since that is expected at the start of the next
* iteration. */
uv_mutex_lock(&mutex);
if (is_slow_work) {
/* `slow_io_work_running` is protected by `mutex`. */
slow_io_work_running--;
}
}
}

Expand Down
5 changes: 1 addition & 4 deletions deps/uv/src/unix/bsd-ifaddrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,13 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
continue;

address = *addresses;
memset(address->phys_addr, 0, sizeof(address->phys_addr));

for (i = 0; i < *count; i++) {
if (strcmp(address->name, ent->ifa_name) == 0) {
#if defined(__CYGWIN__) || defined(__MSYS__)
memset(address->phys_addr, 0, sizeof(address->phys_addr));
#else
struct sockaddr_dl* sa_addr;
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
#endif
}
address++;
}
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/unix/cygwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int uv_uptime(double* uptime) {
int uv_resident_set_memory(size_t* rss) {
/* FIXME: read /proc/meminfo? */
*rss = 0;
return UV_ENOSYS;
return 0;
}

int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
Expand Down
Loading

0 comments on commit 8d645ef

Please sign in to comment.