https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=52d1c851fb0dfa16461d83fdfa4d70643b996edc
commit 52d1c851fb0dfa16461d83fdfa4d70643b996edc Author: Corinna Vinschen <[email protected]> AuthorDate: Thu Dec 5 21:15:13 2024 +0100 Commit: Corinna Vinschen <[email protected]> CommitDate: Fri Dec 6 11:43:17 2024 +0100 Cygwin: cygtls: add volatile qualifier to spinning Given that spinning is only checked once at the start of a _cygtls::interrupt_now() which is called in a loop, it's probably not necessary to mark _cygtls::spinning as volatile. However, spinning is changed from assembler code and we don't want the compiler to make funny assumptions, so, better safe than sorry. Signed-off-by: Corinna Vinschen <[email protected]> (cherry picked from commit 3a9fb7c561d9e8a78e444dd3920c57e857a92baa) Diff: --- winsup/cygwin/local_includes/cygtls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/local_includes/cygtls.h b/winsup/cygwin/local_includes/cygtls.h index 23ef1701a5fe..e4e3889affb3 100644 --- a/winsup/cygwin/local_includes/cygtls.h +++ b/winsup/cygwin/local_includes/cygtls.h @@ -196,7 +196,7 @@ public: /* Do NOT remove this public: line, it's a marker for gentls_offsets. */ waitq wq; int sig; unsigned incyg; - unsigned spinning; + volatile unsigned spinning; volatile unsigned stacklock; __tlsstack_t *stackptr; __tlsstack_t stack[TLS_STACK_SIZE];
