Skip to content

Instantly share code, notes, and snippets.

@mjp41
mjp41 / exch_test.cc
Created December 15, 2021 10:39
TSAN reports an error for this code.
#include <atomic>
#include <thread>
/**
* The following code is a simplification of a bug TSAN reported.
*
* TSAN reports the write on (C) races with (A).
* TSAN does not report (C) races with (B).
* If we remove (A), then TSAN does not report a race.
*