Test AtomicSharedPtr concurrency - #13566
Open
bneradt wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Sanitizer validation completed in the Fedora 44
|
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
include/tsutil/AtomicSharedPtr.h:46
- The PR description mentions removing stale library-version shorthand from the fallback comments, but the earlier comment block still hard-codes libstdc++/libc++ version cutoffs. Consider rewording that top-level comment to describe the feature-based condition instead, so the header stays consistent with the clarified fallback comment below.
// Belt-and-suspenders: on toolchains that take this branch, the free-function
// overloads are normally not marked [[deprecated]], so the suppression below is
// usually a no-op. It matters only if someone forces the fallback on a modern
// library (e.g. -D__cpp_lib_atomic_shared_ptr=0) or compiles against a library
// that ships the deprecation markers ahead of the specialization.
JosiahWI
reviewed
Aug 18, 2026
AtomicSharedPtr protects shared remap configuration during concurrent reloads, but it lacked focused regression coverage. An incorrect load or swap could silently reintroduce a use-after-free race. This adds Catch2 coverage for load, store, and exchange operations and for concurrent readers during repeated writer swaps. It also documents the fallback using the feature-test macro that selects it.
bneradt
force-pushed
the
test-atomic-shared-ptr
branch
from
August 18, 2026 23:03
0bfbe73 to
3da28be
Compare
JosiahWI
requested changes
Aug 19, 2026
Comment on lines
+53
to
+54
| std::atomic<bool> should_start{false}; | ||
| std::atomic<bool> should_stop{false}; |
Contributor
There was a problem hiding this comment.
The std::atomic_flag type would be more suitable for these flags and would simplify the waiting.
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.
Add Catch2 coverage for AtomicSharedPtr load/store/exchange operations and concurrent readers during writer swaps. Also clarify the fallback implementation comment so it no longer relies on stale library-version shorthand.