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

Review QBasicAtomic initializations [QtBase]

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • Core: Threads
    • None
    • e4ef644af (tqtc/lts-6.5), 6b77b43b1 (6.10), 2b0ec367c (6.10), ae5dd04b5 (6.9), b9a9f4dee (6.9), 13780cb96 (tqtc/lts-6.8), 218e91000 (tqtc/lts-6.8), bbf1d6cb9 (tqtc/lts-6.5), b2f359a0d (tqtc/lts-6.5), 3f61f7362 (dev), 02adcda48 (6.10)
    • Foundation Sprint 131, Foundation Sprint 132, Foundation Sprint 133

    Description

      QBasicAtomic inherits the weird pre-C++20 initialization semantics from std::atomic. Cf. https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews#QBasicAtomic

      Review and, where needed, fix QBasicAtomic* initialization:

      • we must not call the default constructor
        • better not even rely on zero-initialization, either (peppe thinks it may also be unsafe)
      • use QAtomic* for non-static/thread-local variables default-constructed atomics
      • otherwise, make sure the variables are initialized with Q_BASIC_ATOMIC_INITIALIZER

      Attachments

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

        Activity

          People

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change