...
The use of cnd_broadcast()
solves the problem avoids these problems because it wakes up all the threads associated with the respective condition variable, and since because all the threads must reevaluate the predicate condition, one should thread will find its test to be true, avoiding the deadlock situation.
Noncompliant Code Example (cnd_signal()
)
...