Subj : Re: Condition variables & mutexes To : comp.programming.threads From : Torsten Robitzki Date : Wed Jan 26 2005 06:26 pm >> but it's hard to see, why you don't just join the thread. >> > > Well, it's just an example. I'm trying to roll my own pthread-safe > version of alarm(). My pt_alarm_init() function creates a new thread, > and that thread needs to do a little bit of initialization before > pt_alarm_init() returns. Is there a reason why you do this initialization in the just spawned thread and not in the initial thread? > My plan is to use a condition variable to > achieve this. If you want a thread to wait for a specific condition to become true, that's the way to go. > Is there a better way? You don't need to qualify thread_is_ready to be volatile and in addition, it buys you nothing to do so. regards Torsten .