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

Review QBasicAtomic initializations [QtBase]

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • Core: Threads
    • None
    • 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), 6263dc513 (6.9), d6da02bba (tqtc/lts-6.8), 9695d6cab (tqtc/lts-6.5)
    • Foundation Sprint 131, Foundation Sprint 132, Foundation Sprint 133, Foundation Sprint 134, Foundation Sprint 135, Foundation Sprint 136, Foundation Sprint 137, Foundation Sprint 138, Foundation Sprint 139, Foundation Sprint 140, Foundation Sprint 141

      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

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

            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

              Created:
              Updated:

                There are no open Gerrit changes