Skip to content

build(deps): optional parking_lot support#1126

Merged
0x676e67 merged 6 commits intomainfrom
lock
Apr 9, 2026
Merged

build(deps): optional parking_lot support#1126
0x676e67 merged 6 commits intomainfrom
lock

Conversation

@0x676e67
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the parking_lot crate as an optional feature for synchronization primitives and refactors src/sync.rs to support it. When the feature is disabled, the code falls back to wrapping std::sync primitives with non-poisoning logic. Review feedback highlighted a regression where synchronization guard types were no longer publicly exported, potentially breaking external API usage. Additionally, suggestions were made to restore #[inline] attributes on Default implementations for Mutex and RwLock to maintain performance parity with the previous version.

Comment thread src/sync.rs
Comment on lines +15 to +23
#[cfg(all(test, feature = "parking_lot"))]
pub use parking_lot::MutexGuard;
#[cfg(feature = "parking_lot")]
pub use parking_lot::{Mutex, RwLock};

#[cfg(all(test, not(feature = "parking_lot")))]
pub use self::std::MutexGuard;
#[cfg(not(feature = "parking_lot"))]
pub use self::std::{Mutex, RwLock};

This comment was marked as spam.

Comment thread src/sync.rs
Comment on lines +80 to 84
impl<T: Default> Default for Mutex<T> {
fn default() -> Self {
Mutex(Default::default())
}
}

This comment was marked as spam.

Comment thread src/sync.rs Outdated
Comment on lines +89 to +90
#[derive(Default)]
pub struct RwLock<T: ?Sized>(sync::RwLock<T>);

This comment was marked as spam.

@0x676e67 0x676e67 merged commit 81a2919 into main Apr 9, 2026
23 checks passed
@0x676e67 0x676e67 deleted the lock branch April 9, 2026 07:45
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