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 no threads are waiting.
The signal has no effect, and therefore is lost.