Subj : Re: Condition variables & mutexes To : comp.programming.threads From : fabrizio Date : Tue Jan 25 2005 05:29 pm > static void *thread(void *arg) > { > pthread_mutex_lock(&mutex); > pthread_cond_signal(&cond); > pthread_mutex_unlock(&mutex); > return NULL; > } > int main(void) > { > pthread_t tid; > > pthread_mutex_lock(&mutex); > pthread_create(&tid, NULL, thread, NULL); > pthread_cond_wait(&cond, &mutex); > pthread_join(tid, NULL); > return 0; > } I am not at all an expert but I think : - you should create the thread before locking the mutex - you should unlock the mutex after the cond_wait int main(void) { pthread_t tid; pthread_create(&tid, NULL, thread, NULL); pthread_mutex_lock(&mutex); pthread_cond_wait(&cond, &mutex); //some ops pthread_mutex_unlock(&mutex); pthread_join(tid, NULL); return 0; } but in this case I am not sure this is gooing to work. you'll find a proper example here : http://www.rt.com/man/pthread_cond_init.3.html good luck .