-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc11_thread2.cpp
More file actions
58 lines (38 loc) · 800 Bytes
/
c11_thread2.cpp
File metadata and controls
58 lines (38 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* =====================================================================================
*
* Filename: thread_c11.cpp
*
* Description:
*
* Version: 1.0
* Created: 09/10/2014 06:49:19 PM CST
* Revision: none
* Compiler: gcc
*
* Author: (),
* Company:
*
* =====================================================================================
*/
#include <iostream>
#include <thread>
using namespace std;
void foo()
{
cout << "foo!!!!!!!!!" << endl;
}
void bar ( int x )
{
cout << "bar " << x << endl;
}
int main ( int argc, char* argv[] )
{
thread first ( foo );
thread second ( bar, 0 );
cout << "main thread" << endl;
first.join();
second.join();
cout << "all completed\n";
return 0;
}