MINOR: fd/threads: make _GET_NEXT()/_GET_PREV() use the volatile attribute
authorWilly Tarreau <w@1wt.eu>
Fri, 20 Dec 2019 06:20:00 +0000 (07:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Dec 2019 11:02:25 +0000 (12:02 +0100)
commitd23e691a288316e9d96794e89e7248601b132d39
tree477e99175a817d87b4d3b72bf060c27e9cf62315
parent5cd8de406cc8537c9c487d31e95f5907b696ede3
MINOR: fd/threads: make _GET_NEXT()/_GET_PREV() use the volatile attribute

These macros are either used between atomic ops which cause the volatile
to be implicit, or with an explicit volatile cast. However not having it
in the macro causes some traps in the code because certain loop paths
cannot safely be used without risking infinite loops if one isn't careful
enough.

Let's place the volatile attribute inside the macros and remove them from
the explicit places to avoid this. It was verified that the output executable
remains exactly the same byte-wise.

(cherry picked from commit 337fb719ee93776cb399a333e04e2438427f0111)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/fd.c