mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-20 00:10:41 -05:00
MINOR: fd: Don't use atomic operations when it's not needed.
In updt_fd_polling(), when updating fd_nbupdt, there's no need to use an atomic operation, as it's a TLS variable.
This commit is contained in:
parent
ca3551f005
commit
a0fdce3950
1 changed files with 1 additions and 3 deletions
|
|
@ -117,15 +117,13 @@ void fd_rm_from_fd_list(volatile struct fdlist *list, int fd, int off);
|
|||
static inline void updt_fd_polling(const int fd)
|
||||
{
|
||||
if ((fdtab[fd].thread_mask & all_threads_mask) == tid_bit) {
|
||||
unsigned int oldupdt;
|
||||
|
||||
/* note: we don't have a test-and-set yet in hathreads */
|
||||
|
||||
if (HA_ATOMIC_BTS(&fdtab[fd].update_mask, tid))
|
||||
return;
|
||||
|
||||
oldupdt = _HA_ATOMIC_ADD(&fd_nbupdt, 1) - 1;
|
||||
fd_updt[oldupdt] = fd;
|
||||
fd_updt[fd_nbupdt++] = fd;
|
||||
} else {
|
||||
unsigned long update_mask = fdtab[fd].update_mask;
|
||||
do {
|
||||
|
|
|
|||
Loading…
Reference in a new issue