On 2023-08-04 05:52, Bruno Haible wrote:
This code is meant to be multithread-safe.
Thanks for fixing that, I hadn't realized it was supposed to be thread-safe (thread-safety is not needed for Coreutils).
Making the variables volatile is a win for multithreaded apps. Although the resulting code is still not 100% thread-safe in theory (because volatile accesses are not atomic), it should be good enough on practical platforms. It's better for readutmp to not depend on support for atomic variables when they're not needed in practice.