haproxy/include
Willy Tarreau a9786b6f04 MINOR: fd: pass the iocb and owner to fd_insert()
fd_insert() is currently called just after setting the owner and iocb,
but proceeding like this prevents the operation from being atomic and
requires a lock to protect the maxfd computation in another thread from
meeting an incompletely initialized FD and computing a wrong maxfd.
Fortunately for now all fdtab[].owner are set before calling fd_insert(),
and the first lock in fd_insert() enforces a memory barrier so the code
is safe.

This patch moves the initialization of the owner and iocb to fd_insert()
so that the function will be able to properly arrange its operations and
remain safe even when modified to become lockless. There's no other change
beyond the internal API.
2018-01-29 16:07:25 +01:00
..
common MEDIUM: fd: use atomic ops for hap_fd_{clr,set} and remove poll_lock 2018-01-29 16:03:15 +01:00
import BUILD: threads/plock: fix a build issue on Clang without optimization 2017-11-20 21:06:35 +01:00
proto MINOR: fd: pass the iocb and owner to fd_insert() 2018-01-29 16:07:25 +01:00
types CLEANUP: fd: remove the unused "new" field 2018-01-29 16:02:59 +01:00