Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- using namespace std;
- void task2();
- void task()
- {
- std::thread t2(task2);
- t2.join();
- }
- void task2()
- {
- *(int *)0xdeadbeef = 42;
- }
- int main(int argc, char **argv) {
- std::thread t1(task);
- t1.join();
- std::cout << "\nthread has been executed";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement