void other_function() { atomic([](read_transaction tx) { if (x.get(tx) != 0) std::terminate(); }); }
void run_other_file() { other_function(); atomic([](transaction tx) { y.set(tx, x.get(tx)); }); atomic([](transaction tx) { w.set(tx, z.get(tx)); }); atomic([](transaction tx) { if (x.untracked_get(tx) != 0) std::terminate(); }); atomic([](read_transaction tx) { if (x.get(tx) != 0) std::terminate(); }); atomic([](read_transaction tx) { if (x.untracked_get(tx) != 0) std::terminate(); }); }
int main() { run_other_file(); atomic([](transaction tx) { x.set(tx, y.get(tx)); }); atomic([](transaction tx) { z.set(tx, w.get(tx)); }); atomic([](transaction tx) { if (x.untracked_get(tx) != 0) std::terminate(); }); atomic([](read_transaction tx) { if (x.get(tx) != 0) std::terminate(); }); atomic([](read_transaction tx) { if (x.untracked_get(tx) != 0) std::terminate(); }); return test_result(); }