Hi,
I've a slot:
Qt Code:
void G2_ImageViewer::readImage() { this->mutex.lock(); if(this->getRingBuffer()->isReadLocked()) { this->readLocked.wait(&this->mutex); } this->mutex.unlock(); this->getRingBuffer()->pop(); }To copy to clipboard, switch view to plain text mode
When the ringbuffer is read locked (this->getRingBuffer()->isReadLocked() == true), it waits that someone unlock it. The problem is that this slot is connected to the signal clicked() of a QPushButton and if the slot is locked and it receives another signal, the program crashes.
How can I do to avoid the problem?
Thank you! Dario
(sorry for my english)
Bookmarks