forked from forhappy/Cplusplus-Concurrency-In-Practice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello-world.cc
More file actions
31 lines (27 loc) · 726 Bytes
/
Copy pathhello-world.cc
File metadata and controls
31 lines (27 loc) · 726 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
/*
* ========================================================================
*
* Filename: hello-world.cc
*
* Description: std::thread hello world example.
*
* Created: 09/14/2013 09:41:12 AM
*
* Author: Fu Haiping (forhappy), haipingf@gmail.com
* Company: ICT ( Institute Of Computing Technology, CAS )
*
* ========================================================================
*/
#include <cstdio>
#include <cstdlib>
#include <iostream> // std::cout
#include <thread> // std::thread
void thread_task() {
std::cout << "hello thread" << std::endl;
}
int main(int argc, const char *argv[])
{
std::thread t(thread_task);
t.join();
return EXIT_SUCCESS;
}