Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QReadWriterLock deadlock on stress test

QReadWriterLock deadlock on stress test

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 374 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Lays147L Offline
    Lays147L Offline
    Lays147
    wrote on last edited by
    #1

    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";
    }
    

    Lays Rodrigues
    Newby on Qt - Learning always!
    Using QT 5.7
    ArchLinux

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved