1 | #include <chrono> |
---|---|
2 | #include <thread> |
3 | |
4 | void f3() { |
5 | int m; |
6 | m = 2; // thread 3 |
7 | } |
8 | |
9 | void f2() { |
10 | int n; |
11 | n = 1; // thread 2 |
12 | std::thread t3(f3); |
13 | t3.join(); |
14 | } |
15 | |
16 | int main() { // main |
17 | std::thread t2(f2); |
18 | t2.join(); |
19 | return 0; |
20 | } |
21 |