pthread_mutex_lock(&mMutex); gThread_B_Finished = true; pthread_mutex_unlock(&mMutex); pthread_cond_signal(&mCondVar); then in your "waiting" routine, do: pthread_mutex_lock(& mMutex); while (gThread_B_Finished == false) pthread_cond_wait(& mCondVar, & mMutex); pthread_mutex_unlock(& mMutex); matt. _______________________________________________ darwin-development mailing list | darwin-development@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development Do not post admin requests to the list. They will be ignored. Would this be better (performance wise) then using an attached thread? You probably wouldn't notice the performance difference, since they use the same underlying mechanism. You'd do something like this at the end of your thread's body routine: And you'll want to add error checking appropriate for your application to the above code, of course.
participants (1)
-
Matt Watson