Repository navigation
fix(soft-rw): isolate subclass singleton registries - #855
Merged
gaborbernat merged 3 commits intoOct 17, 2026
Merged
Conversation
AryanRG
marked this pull request as ready for review
October 17, 2026 00:20
gaborbernat
enabled auto-merge (squash)
October 17, 2026 10:28
gaborbernat
approved these changes
Oct 17, 2026
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.
Constructing a
SoftReadWriteLocksubclass on a path already used by the base class or a sibling can return the other class's cached object. This skips the requested subclass's initializer and overrides:Give each concrete class its own weak singleton cache, reentrant mutex, and construction guard. Reset that state after fork and forward cooperative class-definition keywords. Same-class singleton reuse and recursive-construction rejection are preserved; separate classes still contend on the same underlying lock path.
Regression coverage includes all three construction orders, overlapping constructors across base/sibling/descendant classes, cooperative mixins, recursion and retry, concurrent same-class reuse, and child-process resets while another thread is constructing a subclass. The original three-order regression fails against the unchanged base.
Validation on macOS arm64:
The full tox matrix and other operating systems/runtimes have not been run locally; hosted checks remain separate validation.
AI tools assisted with implementation, testing, and review.