
Tridip C. answered 08/05/20
5+ years of Experience in Programming in C/C++
Pthread condition variables are used to send signals from one thread to another. Sending any signal requires a channel. The mutex variable works as the channel here.
When one thread (A) is doing some computation and another thread (B) is waiting for the result of that computation, the thread A needs to let the waiting thread B know when it has done with the computation.
So, thread B will listen to a channel (a mutex variable) for the signal to arrive and thread A will send the signal on the same channel (the same mutex variable) when it's done.