mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-12 10:06:58 +02:00
BUILD: fd/threads: fix breakage build breakage without threads
The last fix for the volatile dereference made use of pl_deref_int() which is unknown when building without threads. Let's simply open-code it instead. No backport needed.
This commit is contained in:
parent
236062f7ce
commit
821069832e
4
src/fd.c
4
src/fd.c
@ -265,7 +265,7 @@ void fd_rm_from_fd_list(volatile struct fdlist *list, int fd)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
lock_self_next:
|
lock_self_next:
|
||||||
next = pl_deref_int(&fdtab[fd].cache.next);
|
next = ({ volatile int *next = &fdtab[fd].cache.next; *next; });
|
||||||
if (next == -2)
|
if (next == -2)
|
||||||
goto lock_self_next;
|
goto lock_self_next;
|
||||||
if (next <= -3)
|
if (next <= -3)
|
||||||
@ -273,7 +273,7 @@ void fd_rm_from_fd_list(volatile struct fdlist *list, int fd)
|
|||||||
if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.next, &next, -2)))
|
if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.next, &next, -2)))
|
||||||
goto lock_self_next;
|
goto lock_self_next;
|
||||||
lock_self_prev:
|
lock_self_prev:
|
||||||
prev = pl_deref_int(&fdtab[fd].cache.prev);
|
prev = ({ volatile int *prev = &fdtab[fd].cache.prev; *prev; });
|
||||||
if (prev == -2)
|
if (prev == -2)
|
||||||
goto lock_self_prev;
|
goto lock_self_prev;
|
||||||
if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.prev, &prev, -2)))
|
if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.prev, &prev, -2)))
|
||||||
|
Loading…
Reference in New Issue
Block a user