libuv/src/unix
Jameson Nash 88c2af0e65
req: revisions to uv_req_t handling
- Remove the `active_reqs` queue, which is never used. There are more
   efficient per-stream queues that `libuv` uses whenever it needs this
   information, so duplicating it and managing it here seems
   like unnecessary extra space and work.
 - Unix `uv_loop_init` didn't explicitly initialize.
   `loop->active_handles` (although it did memset the whole struct
   to 0, so it wasn't wrong previously, just inconsistent).
 - Consolidate repeated code for `uv__has_active_reqs`.
 - Change `uv__loop_alive` to use the helper functions (mirroring the
   unix copy of the same function).
 - Initialize some more uv_stream_t fields in init, rather than waiting
   for the connection callback. This helps surface bugs in libuv or the
   caller better, since it ensures libuv doesn't see uninitialized
   memory if asked to look at these fields before it thinks the socket
   is connected.
 - Fixes what appears to be a double-counting of `handle->reqs_pending`,
   in the highly-unlikely event that the code wants to emulate IOCP,
   but `RegisterWaitForSingleObject` somehow managed to fail.

PR-URL: https://github.com/libuv/libuv/pull/1746
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-02-25 18:49:37 +01:00
..
aix-common.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
aix.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
android-ifaddrs.c android: fix getifaddrs() 2017-09-26 19:39:32 +02:00
async.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
atomic-ops.h sunos: fix cmpxchgi and cmpxchgl type error 2017-07-01 00:24:42 +02:00
bsd-ifaddrs.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
core.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
cygwin.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
darwin-proctitle.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
darwin.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
dl.c misc: remove unnecessary null pointer checks 2015-11-17 09:18:55 +01:00
freebsd.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
fs.c unix,win: ensure req->bufs is freed 2018-02-21 15:01:52 -05:00
fsevents.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
getaddrinfo.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
getnameinfo.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
ibmi.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
internal.h include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
kqueue.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
linux-core.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
linux-inotify.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
linux-syscalls.c linux,fs: fix p{read,write}v with a 64bit offset 2015-12-03 08:50:28 +01:00
linux-syscalls.h unix: use POLL{IN,OUT,etc} constants directly 2016-04-11 10:51:13 +02:00
loop-watcher.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
loop.c req: revisions to uv_req_t handling 2018-02-25 18:49:37 +01:00
netbsd.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
no-fsevents.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
no-proctitle.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
openbsd.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
os390-syscalls.c zos: implement uv_fs_event* functions 2017-12-15 11:04:16 +01:00
os390-syscalls.h zos: implement uv_fs_event* functions 2017-12-15 11:04:16 +01:00
os390.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
pipe.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
poll.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
posix-hrtime.c unix: factor out reusable POSIX hrtime impl 2017-03-03 15:52:42 +01:00
posix-poll.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
process.c unix,spawn: respect user stdio flags for new pipe 2018-02-25 18:43:34 +01:00
procfs-exepath.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
proctitle.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
pthread-fixes.c unix: fix bug in barrier fallback implementation 2016-04-26 09:35:47 +02:00
signal.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
spinlock.h
stream.c Revert "Revert "unix,tcp: avoid marking server sockets connected"" 2018-02-25 18:45:05 +01:00
sunos.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
sysinfo-loadavg.c unix: factor out reusable sysinfo loadavg impl 2017-05-21 16:12:16 +02:00
sysinfo-memory.c unix: factor out reusable sysinfo memory lookup 2017-05-21 16:12:14 +02:00
tcp.c Revert "Revert "unix,tcp: avoid marking server sockets connected"" 2018-02-25 18:45:05 +01:00
thread.c zos: fix timeout for condition variable 2018-02-15 16:15:23 +01:00
timer.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
tty.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00
udp.c include,src: introduce UV__ERR() macro 2018-02-08 22:38:02 -05:00