cpp11/thread.cc
2012-05-05 09:34:15 -06:00

19 lines
309 B
C++

#include <iostream>
#include <thread>
//This function will be called from a thread
void call_from_thread() {
std::cout << "Hello, World" << std::endl;
}
int main() {
//Launch a thread
std::thread t1(call_from_thread);
//Join the thread with the main thread
t1.join();
return 0;
}