]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: fd: Implement fd_takeover().
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 5 Mar 2020 17:10:51 +0000 (18:10 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 19 Mar 2020 21:07:33 +0000 (22:07 +0100)
commit88516642934539d0103e3e5e0127b04a28152188
tree0252c5d3c1831d796ef259665fb7bebaf1c8809c
parentdc2f2753e97ecfe94827de56ee9efd2cd6d39ad3
MINOR: fd: Implement fd_takeover().

Implement a new function, fd_takeover(), that lets you become the thread
responsible for the fd. On architectures that do not have a double-width CAS,
use a global rwlock.
fd_set_running() was also changed to be able to compete with fd_takeover(),
either using a dooble-width CAS on both running_mask and thread_mask, or
by claiming a reader on the global rwlock. This extra operation should not
have any measurable impact on modern architectures where threading is
relevant.
include/proto/fd.h
src/fd.c