pthread_cond_wait can wake up by itself. you probably want to check for it.
pthread_cond_wait can wake up by itself. you probably want to check for it.