On 26/06/15 13:55, Antti Kantee wrote:
__cpu_simplelock_t was born 15+ years ago with the following commit message: === snip === Let each platform typedef the new __cpu_simple_lock_t, which should be the most efficient type used for the atomic operations in the simplelock structure, and should also be __volatile. === snip === "should also be" doesn't explain much, and may just be there because that's what the pre-simplelock_t definitions used.
I asked thorpej about wouldn't the special interfaces used to manipulate simplelock_t negate the need for volatile, and he said:
Originally, not everything was "special interfaces", and there were C versions for debugging. So, it seems like the original reason to use volatile no longer exists.