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

Thread safety of QThread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • 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

    Description

      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, ...

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-86112
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes