]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: fd: add fd_get_running() to atomically return the running mask
authorWilly Tarreau <w@1wt.eu>
Sat, 9 Jul 2022 12:09:35 +0000 (14:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 18:16:30 +0000 (20:16 +0200)
commitceffd17f52b6b1aa481365fc6f9b88e8efc436e8
tree034e4ceaea66e2ad1fa3104dce11c7d47f88d417
parent080373ea3896781963f647fd1dcea30ab46fa50f
MINOR: fd: add fd_get_running() to atomically return the running mask

The running mask is only valid if the tgid is the expected one. This
function takes a reference on the tgid before reading the running mask,
so that both are checked at once. It returns either the mask or zero if
the tgid differs, thus providing a simple way for a caller to check if
it still holds the FD.
include/haproxy/fd.h