草庐IT

BlockingQueuedConnection

全部标签

关于Qt::BlockingQueuedConnection非死锁的程序卡住

Qt::BlockingQueuedConnection如果sender和receiver运行于同一线程,会报错Qt:DeadlockdetectedwhileactivatingaBlockingQueuedConnection:SenderisXXXX(0x1c2dd42ee50),receiverisYYYY(0x1b8baff600)但发信号的线程和槽执行的线程是两个不同线程,虽然程序没有报错,但卡住不动,也不转圈。上下文如下:UI线程,创建了对象Logic、对象Worker,均没有使用moveToThread;Worker中定义处理函数Loop,通过QtConcurrent::run