Calling pthread_cond_signal() or pthread_cond_broadcast() when the thread does not hold the mutex lock associated with the condition can lead to lost wake-up bugs.
A lost wake-up occurs when
A thread calls pthread_cond_signal() or pthread_cond_broadcast()
And another thread is between the test of the condition and the call to pthread_cond_wait()
And no threads are waiting.
The signal has no effect, and therefore is lost.