I read my teacher’s code, but I don’t understand. Could anyone please tell me the join here mean?
AddTask ^task1 = gcnew AddTask();
AddTask ^task2 = gcnew AddTask();
AddTask ^task3 = gcnew AddTask();
// First Method
Thread ^thread1 = gcnew Thread ( gcnew ParameterizedThreadStart( task1, &AddTask::Add ) );
Thread ^thread2 = gcnew Thread ( gcnew ParameterizedThreadStart( task1, &AddTask::Add ) );
Thread ^thread3 = gcnew Thread ( gcnew ParameterizedThreadStart( task1, &AddTask::Add ) );
thread1->Start("First");
thread2->Start("Second");
thread3->Start("Third");
thread1->Join();
thread2->Join();
thread3->Join();
The Join function blocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping.