]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: fd: Introduce a running mask, and use it instead of the spinlock.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 27 Feb 2020 16:26:13 +0000 (17:26 +0100)
committerOlivier Houchard <cognet@ci0.org>
Tue, 17 Mar 2020 14:30:07 +0000 (15:30 +0100)
commita7bf57352059277239794950f9aac33d05741f1a
tree3d74c63a59c06ba3b6ab0c25a32157b0115d530b
parent2ea1b49832e7617ec97ac7df7a87c8d8328b17e2
MEDIUM: fd: Introduce a running mask, and use it instead of the spinlock.

In the struct fdtab, introduce a new mask, running_mask. Each thread should
add its bit before using the fd.
Use the running_mask instead of a lock, in fd_insert/fd_delete, we'll just
spin as long as the mask is non-zero, to be sure we access the data
exclusively.
fd_set_running_excl() spins until the mask is 0, fd_set_running() just
adds the thread bit, and fd_clr_running() removes it.
include/common/hathreads.h
include/proto/fd.h
include/types/fd.h
src/fd.c