Control each thread by it's own condition variable c++
问题 I am trying to create a program where there is one master thread and multiple worker threads. Worker threads will register themselves in a shared queue and will wait for a signal from master thread to move on. Master thread will check front of queue and will signal that thread by using it's own specific condition variable, to move on. Here is the pseudo-code that i have right now, struct condition{ pthread_cond_t cond_var; pthread_mutex_t lock; }; queue<condition> queue; pthread_mutex_t lock;