Files
concurrency-in-action/source/listing_2.5.cpp
2014-04-22 21:54:16 -04:00

28 lines
369 B
C++

#include <thread>
void some_function()
{}
void some_other_function(int)
{}
std::thread f()
{
void some_function();
return std::thread(some_function);
}
std::thread g()
{
void some_other_function(int);
std::thread t(some_other_function,42);
return t;
}
int main()
{
std::thread t1=f();
t1.join();
std::thread t2=g();
t2.join();
}