#include <iostream>
#include <thread>
using std::cout;
using std::endl;
void thread_function()
{
for (int i = 0; i < 100000; i++);
cout << "thread_function()" << endl;
}
int main()
{
std::thread threadObj(thread_function);
for (int i = 0; i < 100000; i++);
cout << "main()" << endl;
threadObj.join();
cout << "end main()" << endl;
return 0;
}
/*
run:
thread_function()
main()
end main()
*/