Hello..
Im working on a program that I should tell to stop and wait until something happens in another thread. What would be the best/right way to do this?
Thank you
Hello..
Im working on a program that I should tell to stop and wait until something happens in another thread. What would be the best/right way to do this?
Thank you
You can use an event object. It is created with CreateEvent. A thread waits on it using WaitForSingleObject. When it is time for that thread to be woken, the other thread can call SetEvent. Synchronisation can be tricky, read this blog post for discussion of some of the issues.