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 07:09:28 +0000 (08:09 +0100)
commit337fb719ee93776cb399a333e04e2438427f0111
treec4e43fa863f2ccb317f0147e409cde53bb1eca2b
parent54907bb848962cc89d18fffb40af32010e4090b0
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.
src/fd.c