1#include "test_utils.h"
2int   var = 0;
3extern "C" { // TODO: make this line empty when ignore vs. mangling is fixed.
4void Thread1() {
5  usleep(100000);
6  var = 1;
7}
8
9void Empty() {
10}
11
12void X() {
13  if (var) {
14    Empty();
15  }
16  var = 2;
17}
18
19void Y() {
20  if (var) {
21    Empty();
22  }
23  X();
24}
25
26void Thread2() {
27  Y();
28}
29} // TODO: make this line empty when ignore vs. mangling is fixed.
30int main() {
31  ANNOTATE_TRACE_MEMORY(&var);
32  var = 0;
33  MyThread t1(Thread1, NULL, "test-thread-1");
34  MyThread t2(Thread2, NULL, "test-thread-2");
35  t1.Start();
36  t2.Start();
37  t1.Join();
38  t2.Join();
39}
40