mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
BUG/MEDIUM: fd: Call fd_stop_recv() when we just got a fd.
In fd_takeover(), when a double-width compare-and-swap is implemented, make sure, if we managed to get the fd, to call fd_stop_recv() on it, so that the thread that used to own it will know it has to stop polling it.
This commit is contained in:
parent
8d7b517824
commit
ddc874c46c
6
src/fd.c
6
src/fd.c
@ -389,6 +389,12 @@ int fd_takeover(int fd, void *expected_owner)
|
|||||||
} while (!(_HA_ATOMIC_DWCAS(&fdtab[fd].running_mask, &old_masks,
|
} while (!(_HA_ATOMIC_DWCAS(&fdtab[fd].running_mask, &old_masks,
|
||||||
&new_masks)));
|
&new_masks)));
|
||||||
_HA_ATOMIC_AND(&fdtab[fd].running_mask, ~tid_bit);
|
_HA_ATOMIC_AND(&fdtab[fd].running_mask, ~tid_bit);
|
||||||
|
/* Make sure the FD doesn't have the active bit. It is possible that
|
||||||
|
* the fd is polled by the thread that used to own it, the new thread
|
||||||
|
* is supposed to call subscribe() later, to activate polling.
|
||||||
|
*/
|
||||||
|
fd_stop_recv(fd);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif /* HW_HAVE_CAS_DW */
|
#endif /* HW_HAVE_CAS_DW */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user