https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3a9fb7c561d9e8a78e444dd3920c57e857a92baa
commit 3a9fb7c561d9e8a78e444dd3920c57e857a92baa Author: Corinna Vinschen <cori...@vinschen.de> AuthorDate: Thu Dec 5 21:15:13 2024 +0100 Commit: Corinna Vinschen <cori...@vinschen.de> CommitDate: Thu Dec 5 21:16:03 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 <cori...@vinschen.de> 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 efbd557b1ff0..b7efcdae2c46 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 current_sig; unsigned incyg; - unsigned spinning; + volatile unsigned spinning; volatile unsigned stacklock; __tlsstack_t *stackptr; __tlsstack_t stack[TLS_STACK_SIZE];