Is it safe to have 2 or more threads call the Win32 API’s SetEvent on the same event handler not being protected by a critical section?
Share
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 safe, but remember that if one thread Sets it, and another thread Sets it at the same time, you’re not going to get two notifications, just one; since the 2nd one changed it from True to…True. If you’re worried about this, use Semaphores instead.