[SERVER-60390] Replace incorrect assertion in AtomicWord with is_always_lock_free from TODO C++17 Created: 01/Oct/21  Updated: 29/Oct/23  Resolved: 08/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Bug Priority: Major - P3
Reporter: Andrew Shuvalov (Inactive) Assignee: Andrew Shuvalov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2021-10-18
Participants:
Linked BF Score: 29

 Description   

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.



 Comments   
Comment by Githook User [ 08/Oct/21 ]

Author:

{'name': 'Andrew Shuvalov', 'email': 'andrew.shuvalov@mongodb.com', 'username': 'shuvalov-mdb'}

Message: SERVER-60390 Make AtomicWord assert is_always_lock_free
Branch: master
https://github.com/mongodb/mongo/commit/4745396d015db9df8f9c2c24932c8d2e8648e718

Generated at Thu Feb 08 05:49:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.