1 | #include <unistd.h> |
---|---|
2 | |
3 | __thread int var_shared = 33; |
4 | |
5 | int |
6 | touch_shared() |
7 | { |
8 | return var_shared; |
9 | } |
10 | |
11 | void shared_check() |
12 | { |
13 | var_shared *= 2; |
14 | usleep(useconds: 1); // shared thread breakpoint |
15 | } |
16 |
1 | #include <unistd.h> |
---|---|
2 | |
3 | __thread int var_shared = 33; |
4 | |
5 | int |
6 | touch_shared() |
7 | { |
8 | return var_shared; |
9 | } |
10 | |
11 | void shared_check() |
12 | { |
13 | var_shared *= 2; |
14 | usleep(useconds: 1); // shared thread breakpoint |
15 | } |
16 |