Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60390

Replace incorrect assertion in AtomicWord with is_always_lock_free from TODO C++17

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Sharding 2021-10-18
    • 29

      Static assertion that AtomicWord is integral is backwards. In this code:

      MONGO_STATIC_ASSERT(!std::is_integral<T>::value ||                         
              sizeof(T) == sizeof(atomic_word_detail::Base<T>));
      

      should be `std::is_integral<T>::value`. Fortunately everything still compiles with that fix, at least on Intel.

      However, instead I'm removing this assertion all together and replacing with TODO from a while back to implement `std::atomic<WordType>::is_always_lock_free` assertion.

            Assignee:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Reporter:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: