]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: fd/threads: fix breakage build breakage without threads
authorWilly Tarreau <w@1wt.eu>
Tue, 6 Feb 2018 11:00:27 +0000 (12:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 6 Feb 2018 11:00:27 +0000 (12:00 +0100)
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.

src/fd.c

index 87db0e96d22c7113f8ad901e08fb6eb97794c18d..d6c140c0ce057778b1d36ab0de00a836d4b921bb 100644 (file)
--- a/src/fd.c
+++ b/src/fd.c
@@ -265,7 +265,7 @@ lock_self:
 
 #else
 lock_self_next:
-       next = pl_deref_int(&fdtab[fd].cache.next);
+       next = ({ volatile int *next = &fdtab[fd].cache.next; *next; });
        if (next == -2)
                goto lock_self_next;
        if (next <= -3)
@@ -273,7 +273,7 @@ lock_self_next:
        if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.next, &next, -2)))
                goto lock_self_next;
 lock_self_prev:
-       prev = pl_deref_int(&fdtab[fd].cache.prev);
+       prev = ({ volatile int *prev = &fdtab[fd].cache.prev; *prev; });
        if (prev == -2)
                goto lock_self_prev;
        if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.prev, &prev, -2)))