QReadWriterLock deadlock on stress test
-
Hi!
I'm trying to lock and unlock thread for read and write functions on my arduino. Its seams look right, but when i make a stress test, the app freeze on a deadlock(i think) and my program stops.
This is my code, i'm doing something wrong?void BrPrint3D::on_bt_table_clicked(bool checked) { this->mutexIno.lockForWrite(); //QWriteLocker locker(&mutexIno); //if(this->mutexIno.tryLock(200)) //{ //QMutexLocker locker(&mutexIno); qDebug()<<"Lock Done - Mesa"; if(checked==true) { ui->bt_table->setStyleSheet("background-color:red;"); this->printer_object->setBedTemp(ui->tbMC_TableTemperature->text().toFloat()) ==true? qDebug()<<"Ok": qDebug()<<"~Ok"; //qDebug()<<"Ok"; } else { this->printer_object->setBedTemp(0); ui->bt_table->setStyleSheet(""); } /*else qDebug()<<"Timeout";*/ this->mutexIno.unlock(); qDebug() <<"Unlock done - Mesa"; }