Reputation:
The way I am waiting on a thread to start is by creating an event, and when I create a thread, I pass it this event, and when the thread starts executing, it signals this event (which I am already waiting on). I have no problem with this approach, but I am wondering if Windows provides a special function for this.
Upvotes: 3
Views: 99
Reputation: 612784
Your current solution is a perfectly good solution to the problem. You've no reason or need to look for a better solution. Certainly the threading API doesn't offer you any built-in mechanism so you do have to implement something. And what you are doing is a fine way to solve the problem.
Upvotes: 4