Hello,
You create only 2 threads, but seem to assume that 3 threads are running.
You need to create 3 threads:
struct data_race_test : rl::test_suite<data_race_test, 3>{
And then execute first part of code by 2 threads:
if(id == 0 || id == 2){
Note the test executed multiple times, but each run starts from clean
slate. No state is accumulated between runs.
--
Dmitry Vyukov
All about lockfree/waitfree algorithms, multicore, scalability,
parallel computing and related topics:
http://www.1024cores.net