7
// do not forget to use -lpthread with g++
9
void fun(size_t count, char const *txt)
13
cout << count << ": " << txt << endl;
17
{ // runs the threads following
18
// the object construction
19
thread display(fun, 3, "hello world");
22
thread second(fun, 3, "a second thread");
25
cout << "leaving" << endl;