conditionvariable
A condition variable is a synchronization primitive used in concurrent programming. It allows threads to wait efficiently for a certain condition to become true. When a thread needs to wait, it atomically releases a mutex associated with the condition variable and goes to sleep. Another thread, after changing the state that might satisfy the condition, can signal or broadcast to wake up one or all of the waiting threads.
Threads waiting on a condition variable must also hold a mutex. This mutex is used to protect
Signaling a condition variable typically involves waking up at least one waiting thread. Broadcasting wakes up