1 | #include <cassert> |
---|---|
2 | #include <iostream> |
3 | #include <thread> |
4 | |
5 | void g() { assert(false); } |
6 | |
7 | void f() { g(); } |
8 | |
9 | size_t h() { |
10 | size_t sum = 0; |
11 | for (size_t i = 0; i < 1000000; ++i) |
12 | for (size_t j = 0; j < 1000000; ++j) |
13 | if ((i * j) % 2 == 0) { |
14 | sum += 1; |
15 | } |
16 | return sum; |
17 | } |
18 | |
19 | int main() { |
20 | std::thread t1(f); |
21 | |
22 | size_t x = h(); |
23 | |
24 | t1.join(); |
25 | |
26 | std::cout << "X is "<< x << "\n"; |
27 | return 0; |
28 | } |
29 |