mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-12 10:06:58 +02:00
MINOR: fd: remove the unneeded last CAS when adding an fd to the list
This was a leftover from the initial code where two threads could fight for the list's tail.
This commit is contained in:
parent
abeaff2d54
commit
3a8263f86b
7
src/fd.c
7
src/fd.c
@ -233,12 +233,7 @@ void fd_add_to_fd_list(volatile struct fdlist *list, int fd)
|
|||||||
} while (1);
|
} while (1);
|
||||||
}
|
}
|
||||||
/* Then, update the last entry */
|
/* Then, update the last entry */
|
||||||
redo_fd_cache:
|
list->last = fd;
|
||||||
last = list->last;
|
|
||||||
__ha_barrier_load();
|
|
||||||
|
|
||||||
if (unlikely(!HA_ATOMIC_CAS(&list->last, &last, fd)))
|
|
||||||
goto redo_fd_cache;
|
|
||||||
__ha_barrier_store();
|
__ha_barrier_store();
|
||||||
fdtab[fd].cache.next = -1;
|
fdtab[fd].cache.next = -1;
|
||||||
__ha_barrier_store();
|
__ha_barrier_store();
|
||||||
|
Loading…
Reference in New Issue
Block a user