Skip to content
  • 0 Votes
    27 Posts
    9k Views
    T
    @kshegunov Thanks. I can reproduce the same behavior with a single thread. #include <QtCore> struct Object: QObject{ Q_OBJECT public slots: void foo(){ qDebug() << __LINE__; while(entered) qApp->processEvents(); qDebug() << __LINE__; QEventLoop loop; QTimer::singleShot(1000, &loop, SLOT(quit())); entered = true; loop.exec(); entered = false; qDebug() << __LINE__; } private: bool entered = false; }; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); Object w; QTimer::singleShot(0, &w, SLOT(foo())); QTimer::singleShot(0, &w, SLOT(foo())); QTimer::singleShot(3000, &a, SLOT(quit())); a.exec(); qDebug() << __LINE__; } #include "main.moc" In fact, it has nothing to do with multi-threads. I have never studied Qt source code. It seems exec will not return before all slots finish. So, the code actually creates a dead lock.
  • 0 Votes
    8 Posts
    6k Views
    F
    Ok, thanks, I think I have all information I need now.
  • GIL deadlocks with PySide

    Language Bindings pyside deadlock gil
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied