在 2025-10-23 02:40, Pali Rohár 写道:
Thank you very much for information. So from this information it looks
like that the volatile keyword is not required on more places in
mingw-w64-libraries/winpthreads/src/spinlock.c file.

Would you have a time to revisit that file?

There are 6 occurrences of `volatile` in spinlock.c, and they are all parts of pointee types, so I believe all of them are unnecessary.

There are some uses in other files, as parts of definitions of fields or variables, like in mutex.c and in thread.c. Those fields should be read with atomic operations, but at the moment they aren't, so `volatile` isn't safe to remove there for now. (I don't know how to do `__atomic_load_n` in MSVC.)


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to