Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- using namespace std;
- void test(int i, int j) {
- cout << i+j << endl;
- }
- void test_thread() {
- int num1 = 3;
- int num2 = 4;
- int num3 = 1;
- int num4 = 2;
- thread t1(test, num1, num2);
- thread t2(test, num3, num4);
- t1.join();
- t2.join();
- }
- int main()
- {
- test_thread();
- cout << "final finish" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement