#543·EASTL

Usage of atomic_thread_fence in shared_ptr.h can cause false-positives w/ TSAN

Author: romasandu-gaijinCreated Sep 25, 2024Updated Aug 3, 2025

Thread sanitizer does not work with atomic_thread_fences and unlikely ever will. Every usage of atomic_thread_fence must be guarded by an #if !TSAN or a similar construction for correctness of synchronization to be verifiable via TSAN.

This also breaks TSAN compilation with latest GCC, as it now warns about usage of fences when TSAN is enabled (and rightly so!)