Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86112

Thread safety of QThread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.15.1
    • 5.15.0 RC2
    • Documentation
    • None
    • All
    • d3ccb5904d30d8d94b828d41f145f6f88b4ca9d7 (qt/qtbase/dev) f980b91c79c8f75b45fe4c8a5ae2405bb936e784 (qt/qtbase/5.15)
    • Da Vinci sprint 15

      The QThread documentation doesn't mention which functions are thread-safe.

      However, one would expect that at least QThread::quit and QThread::exit are thread safe, to be able to terminate the thread from within the new and the old thread.

      Inspecting the code (https://code.woboq.org/qt5/qtbase/src/corelib/thread/qthread.cpp.html#568), indeed reveals a mutex mechanism is precent.

      Also many other members functions are guarded by a mutex: QThread::setPriority, QThread::requestInterruption, QThread::isRunning, ...

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            paulwicking Paul Wicking
            m3197d - -
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes