Subj : pthread_cond_signal() semantics To : comp.programming.threads From : William Hoggarth Date : Sat Jan 08 2005 11:32 pm I have a thread with similar to the following: while(1) { get_input(); pthread_mutex_lock(&mutex); copy_input_to_buffer(); pthread_cond_signal(&cond); pthread_mutex_unlock(&mutex); } The thread seems to reaquire the mutex lock before the thread I'm signalling wakes up. Putting sched_yield() at the end of the loop results in the behaviour I'm expecting: the thread waiting on the condition variable wakes up, aquiring the mutex. Does this mean that pthread_cond_signal() allows other threads to lock the mutex before the waiting thread wakes up with the lock on the mutex? Does pthread_cond_signal() just make the signalled thread runnable, with the guarantee of the mutex lock when it runs? What are the exact semantics of pthread_cond_signal()? Thanks for the help, William Hoggarth .