ThreadSanitizer understands various flavors of compiler built-in atomic operations:
ThreadSanitizer
If std::atomic<> type is implemented using some sort of compiler built-ins (e.g. libc++), then ThreadSanitizer will understand it as well.
Also ThreadSanitizer runtime provides own set of atomic operations of the form:
__tsan_atomic8 __tsan_atomic8_load(const volatile __tsan_atomic8 *a, __tsan_memory_order mo);
The full list is available here.
So there are 3 options:
You can see an example of option 2 here.
There was an error while loading. Please reload this page.