Home > Software engineering >  Multithreaded synchronization out of question
Multithreaded synchronization out of question

Time:10-21

Excuse me how in front of the main program exit, synchronization of multiple threads to exit? See related blog proposals to create a thread monitoring, after listening to judge all threads thread exit, and then shut the main thread, excuse me how actual operation,

CodePudding user response:

The main thread to notify the child thread exits, can send a message or EVENT to inform them,
WaitForMultipleObjects (hEvent, _countof (hEvent), TRUE, INFINITE). All threads waiting for the exit
  • Related