]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: fd: slightly optimize the fd_takeover double-CAS loop
authorWilly Tarreau <w@1wt.eu>
Thu, 18 Jun 2020 06:05:15 +0000 (08:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 18 Jun 2020 06:08:50 +0000 (08:08 +0200)
commit4297363de3985d0b0bd55f03420c3db200ef43da
tree9fc17c3751d7a9ab7b6ed969d63356f5852fd32f
parentc460c91633d5407a02f9d3aadf0abece5a4e4b45
MINOR: fd: slightly optimize the fd_takeover double-CAS loop

The loop in fd_takeover() around the double-CAS is conditionned on
a previous value of old_masks[0] that always matches tid_bit on the
first iteration because it does not result from the atomic op but
from a pre-loaded value. Let's set the result of the atomic op there
instead so that the conflict between threads can be detected earlier
and before performing the double-word CAS.
src/fd.c