Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- #include <vector>
- using namespace std;
- unsigned u = 0;
- void foo()
- {
- u++;
- }
- int main()
- {
- vector<thread> threads;
- for(int i = 0; i < 1000; i++) {
- threads.push_back (thread (foo));
- }
- for (auto& t : threads) t.join();
- cout << u << endl;
- return 0;
- }
- if (u % 3 == 0) {
- u += 4;
- } else {
- u -= 1;
- }
- foo():
- add DWORD PTR u[rip], 1
- ret
- void foo()
- {
- unsigned i = u;
- for (int s=0;s<10000;s++);
- u = i+1;
- }
- if (u % 2) {
- u += 2;
- } else {
- u -= 1;
- }
Add Comment
Please, Sign In to add comment