Skip to content

gbitlock: Drop unnecessary volatile qualifiers

Philip Withnall requested to merge pwithnall/glib:2418-more-stupid-atomics into main

This follows on from !1719 (merged). It drops volatile qualifiers on internal functions in gbitlock.c, and casts volatile public arguments to non-volatile versions to avoid the g_atomic_*() macros from propagating the volatile qualifier.

We can’t drop the volatile qualifier from the public API in gbitlock.h, as that would unfortunately be an API break.

Update the documentation in gbitlock to mention that users of the API should not use volatile. See http://isvolatileusefulwiththreads.in/c/

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Fixes: #2418 (closed)

Merge request reports