BUG/MEDIUM: fd: Take the fd_mig_lock when closing if no DWCAS is available.
authorOlivier Houchard <cognet@ci0.org>
Thu, 25 Mar 2021 00:38:54 +0000 (01:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 25 Mar 2021 06:51:10 +0000 (07:51 +0100)
commit5fbd555100827371046612ee31e5226af30e4ad6
treedfffbfe5fbeefbc9bb484e5be3736c711e82c044
parentb8ca98360cd92c410370a5752d4c5c935c684d9e
BUG/MEDIUM: fd: Take the fd_mig_lock when closing if no DWCAS is available.

In fd_delete(), if we're running with no double-width cas, take the
fd_mig_lock before setting thread_mask to 0 to make sure that
another thread calling fd_set_running() won't miss the new value of
thread_mask and set its bit in running_mask after we checked it.

This should be backported to 2.2 as part of the series fixing fd_delete().

(cherry picked from commit c23b33764ea88587193472283c3e2d7a88448392)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/fd.c