I know that the join method blocks the current thread and waits until the task is done. So how is it possible that I can do something like this:
void task()
{
   while(true)
   {
       //do stuff
   }
}
int main()
{
   std::thread t1(task);
   t1.join();
   std::cout << "HELLO" << std::endl;
}
and still see "HELLO" after executing this code. Why does this work?
 
     
    