From: bel2125 Date: Fri, 18 Apr 2025 08:54:32 +0000 (+0200) Subject: Modify STOP_FLAG_ASSING to make TSAN happy (#1333) X-Git-Url: https://git.feebdaed.xyz/?a=commitdiff_plain;h=a87a7aaffd182ee5b5f158f74f5825728e162306;p=0xmirror%2Fcivetweb.git Modify STOP_FLAG_ASSING to make TSAN happy (#1333) --- diff --git a/CREDITS.md b/CREDITS.md index f1e1d150..f6a2a79d 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -130,6 +130,7 @@ * Lammert Bies * Lars Immisch * Lawrence +* Lev275568 * Li Peng * Lianghui * Lorenzo Canepa diff --git a/src/civetweb.c b/src/civetweb.c index 9e098045..e09bcf3a 100644 --- a/src/civetweb.c +++ b/src/civetweb.c @@ -2339,7 +2339,9 @@ STOP_FLAG_ASSIGN(stop_flag_t *f, stop_flag_t v) { stop_flag_t sf = 0; do { - sf = mg_atomic_compare_and_swap(f, *f, v); + sf = mg_atomic_compare_and_swap(f, + __atomic_load_n(f, __ATOMIC_SEQ_CST), + v); } while (sf != v); }