Conversation
There was a problem hiding this comment.
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.
| #[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.
This comment was marked as spam.
Sorry, something went wrong.
| impl<T: Default> Default for Mutex<T> { | ||
| fn default() -> Self { | ||
| Mutex(Default::default()) | ||
| } | ||
| } |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| #[derive(Default)] | ||
| pub struct RwLock<T: ?Sized>(sync::RwLock<T>); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
No description provided.