Thanks, I will study this carefully!....
I want to be sure to understand this properly...
you're saying that a construct like:
is not safe?Qt Code:
if(!asyncqueue.isEmpty()) asyncqueue.pull()To copy to clipboard, switch view to plain text mode
because between the actual test of emptiness and the actual pull, another thread could have pulled, emptying the queue possibly... and so my pull will fail...
Is that correct?
and that's why you added the semaphore on top of the mutex protection?....
Bookmarks