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

Thread safety of QThread

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15.0 RC2
    • Fix Version/s: 5.15.1
    • Component/s: Documentation
    • Labels:
      None
    • Platform/s:
      All
    • Commits:
      d3ccb5904d30d8d94b828d41f145f6f88b4ca9d7 (qt/qtbase/dev) f980b91c79c8f75b45fe4c8a5ae2405bb936e784 (qt/qtbase/5.15)
    • Sprint:
      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

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

            Activity

              People

              Assignee:
              paulwicking Paul Wicking
              Reporter:
              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