How do I wait for a thread to die in Windows? This is what I want my code to look like:
main thread:
creating thread: thread1
waiting for thread1 to die
//rest of the code
I am using Win32 API.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s easy: the WaitForSingleObject can block current thread given the other thread’s handle.