[Interest] ThreadSafeQueue class deadlocks after consumer acquire
nilesh.kokane05 at gmail.com
Sat Jul 30 21:17:27 CEST 2016
I've a threadsafe queue designed as below. I'm pushing data from one
thread and popping from the other thread, but the pop is not working.
The movement I consumer.acquire() in the pop function from the other
thread it goes to dead lock.
#define MAX_COUNT 1000
static unsigned int count = MAX_COUNT;
static QSemaphore producer(count);
static QSemaphore consumer;
void push(const T& t)
qDebug() << "value in push" << t;
T i = m_queue.dequeue();
The push function is called for 1000 times though. Any clue?
More information about the Interest