Ken Thomases ken@codeweavers.com writes:
- {
CFRunLoopAddSource( CFRunLoopGetMain(), source, kCFRunLoopCommonModes );
CFRunLoopSourceSignal( source );
CFRunLoopWakeUp( CFRunLoopGetMain() );
CFRelease( source );
/* This is a hack. We want to wait until the main thread has
* really exited in response to our signal. However, Mac OS X
* doesn't let us join the main thread for whatever reason.
* It results in a SIGBUS. So, we just sleep for a bit and hope
* it got enough time. */
usleep(100);
We need something more reliable than this.
(The pthread_join crash is a bug in libsystem, I filed a bug a while back but haven't heard anything).