diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /lib/ft8var/ft8_tsan.c | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'lib/ft8var/ft8_tsan.c')
| -rw-r--r-- | lib/ft8var/ft8_tsan.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/ft8var/ft8_tsan.c b/lib/ft8var/ft8_tsan.c new file mode 100644 index 00000000..1905ca07 --- /dev/null +++ b/lib/ft8var/ft8_tsan.c @@ -0,0 +1,30 @@ +#if defined(__SANITIZE_THREAD__) +#include <sanitizer/tsan_interface.h> +#endif + +// GCC TSan does not observe libgomp synchronization. Stable tokens mirror the +// OpenMP edges without changing production synchronization. +#if defined(__SANITIZE_THREAD__) +#define WSJT_TSAN_SYNC(name) \ + static unsigned char name##_token; \ + void wsjt_tsan_acquire_##name(void) \ + { \ + __tsan_acquire(&name##_token); \ + } \ + void wsjt_tsan_release_##name(void) \ + { \ + __tsan_release(&name##_token); \ + } +#else +#define WSJT_TSAN_SYNC(name) \ + void wsjt_tsan_acquire_##name(void) {} \ + void wsjt_tsan_release_##name(void) {} +#endif + +WSJT_TSAN_SYNC(ft8_mtd) +WSJT_TSAN_SYNC(four2avar_setup) +WSJT_TSAN_SYNC(ft8_find_dupes) +WSJT_TSAN_SYNC(ft8_update_structures) +WSJT_TSAN_SYNC(decoder_section_primary) +WSJT_TSAN_SYNC(decoder_section_secondary) +WSJT_TSAN_SYNC(msk40_sync) |
