Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(maitake-sync): add spin::RwLock #472

Merged
merged 4 commits into from
Jan 27, 2024
Merged

feat(maitake-sync): add spin::RwLock #472

merged 4 commits into from
Jan 27, 2024

Conversation

hawkw
Copy link
Owner

@hawkw hawkw commented Jan 27, 2024

This commit adds a synchronous RwLock spinlock to
maitake_sync::spin.

hawkw added 4 commits January 27, 2024 11:19
This fixes an issue where the non-`loom` test wrappers would eat logs
from spawned threads, because the thread-local `tracing` subscriber was
not propagated correctly.
This fixes an issue where the `util::Backoff` helper in `maitake_sync`
would emit too many spins in loom mode, hitting the branch limit.
This commit adds a synchronous `RwLock` spinlock to
`maitake_sync::spin`.

Closes #470
@hawkw hawkw enabled auto-merge (rebase) January 27, 2024 19:21
@hawkw hawkw merged commit d6199bf into main Jan 27, 2024
17 checks passed
@hawkw hawkw deleted the eliza/spin-rwlock branch January 27, 2024 19:26
hawkw added a commit that referenced this pull request Jan 27, 2024
This fixes an issue where the non-`loom` test wrappers would eat logs
from spawned threads, because the thread-local `tracing` subscriber was
not propagated correctly.
hawkw added a commit that referenced this pull request Jan 27, 2024
hawkw added a commit that referenced this pull request Jan 27, 2024
This fixes an issue where the `util::Backoff` helper in `maitake_sync`
would emit too many spins in loom mode, hitting the branch limit.
hawkw added a commit that referenced this pull request Jan 27, 2024
This commit adds `Default` impls to `Mutex`, `RwLock`, and `spin::Mutex`
where `T: Default`, allowing locked data to be constructed through
`Default` without needing `Mutex::new(Default::default())` or similar.

An implementation of `Default` for `spin::RwLock` was not added, because
I already did that in #472.
hawkw added a commit that referenced this pull request Jan 27, 2024
This commit adds `Default` impls to `Mutex`, `RwLock`, and `spin::Mutex`
where `T: Default`, allowing locked data to be constructed through
`Default` without needing `Mutex::new(Default::default())` or similar.

An implementation of `Default` for `spin::RwLock` was not added, because
I already did that in #472.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant