[Interest] ThreadSafeQueue class deadlocks after consumer acquire

Konstantin Shegunov kshegunov at gmail.com
Sat Jul 30 23:44:06 CEST 2016


On Sat, Jul 30, 2016 at 10:17 PM, Nilesh Kokane <nilesh.kokane05 at gmail.com>
> The push function is called for 1000 times though. Any clue?

When the pushing of data finishes all threads that are waiting for new data
will be hanging on consumer.acquire(). Since you provide no way for them to
continue, or to know that there's nothing more to pop() ... well they just
sit patiently and wait for the semaphore.

Kind regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160731/ad8da35b/attachment.html>

More information about the Interest mailing list