
23 Sep
2005
23 Sep
'05
10:53 p.m.
Jason Hise wrote:
The problem is that joining x before main exits forces the process to wait until x is done sleeping before main can exit. If there is no way to wake up a sleeping thread, then it appears my only option is to sleep for very short intervals and keep checking two conditions to see if sleeping should stop (time elapsed, or early wakeup signaled).
Can't you block on the condition variable as usual and use notify_all in the main thread to wake everyone up so that they can check the "should_exit" flag?