Strengthen exception specifications for [thread] types#3388
Merged
Conversation
- `condition_variable`'s default constructor and `native_handle` - `recursive_mutex`'s default constructor - all `adopt_lock_t` constructors Also make some special member functions defaulted.
Both the default constructor and destructor are trivial now, so we need to suppress warnings.
StephanTLavavej
approved these changes
Feb 13, 2023
Member
|
Looks good to me. As before, I believe this is ABI-safe because no copy ctors are being defaulted. |
strega-nil-ms
approved these changes
Feb 13, 2023
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for making our threads stronger! 🧵 🦾 😹 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3324. Towards #363.
These functions are made
noexcept._Mutex_base::try_lock(i.e.mutex::try_lock) (analysis:<mutex>: Is_Mutex_base::try_lockactuallynoexcept? #3324 (comment))notify_all_at_thread_exitcondition_variable's default constructor,native_handle, andwaitrecursive_mutex's default constructoradopt_lock_tconstructorsAlso make some special member functions defaulted.
thread::id's default constructorunique_lock's default constructorscoped_lock<>'s default constructor and destructor, also strengthening exception specificationtimed_mutex,recursive_timed_mutex, andshared_timed_mutex's default constructors, keeping exception specification strengthened (some comments were missing before, although IMO we don't need to add back now)Comment changes:
timed_mutex::try_lockisn't markednoexceptin working draft ([thread.timedmutex.class]). So this PR adds the missing/* strengthened */comment.