From 20fa3a0d8f529b428eeacf7cce184345f200654d Mon Sep 17 00:00:00 2001 From: Zachary S Date: Mon, 23 Oct 2023 17:03:17 -0500 Subject: [PATCH] Fix Condvar typo, add public re-exports of Mapped*Guard. --- library/std/src/sync/mod.rs | 4 ++++ library/std/src/sync/mutex.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs index f6a7c0a9f7549..ca62179e95b66 100644 --- a/library/std/src/sync/mod.rs +++ b/library/std/src/sync/mod.rs @@ -165,6 +165,8 @@ pub use core::sync::Exclusive; pub use self::barrier::{Barrier, BarrierWaitResult}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::condvar::{Condvar, WaitTimeoutResult}; +#[unstable(feature = "mapped_lock_guards", issue = "117108")] +pub use self::mutex::MappedMutexGuard; #[stable(feature = "rust1", since = "1.0.0")] pub use self::mutex::{Mutex, MutexGuard}; #[stable(feature = "rust1", since = "1.0.0")] @@ -172,6 +174,8 @@ pub use self::mutex::{Mutex, MutexGuard}; pub use self::once::{Once, OnceState, ONCE_INIT}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::poison::{LockResult, PoisonError, TryLockError, TryLockResult}; +#[unstable(feature = "mapped_lock_guards", issue = "117108")] +pub use self::rwlock::{MappedRwLockReadGuard, MappedRwLockWriteGuard}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard}; diff --git a/library/std/src/sync/mutex.rs b/library/std/src/sync/mutex.rs index a435fba4f1ea2..5a419f4bd8465 100644 --- a/library/std/src/sync/mutex.rs +++ b/library/std/src/sync/mutex.rs @@ -221,7 +221,7 @@ unsafe impl Sync for MutexGuard<'_, T> {} /// of scope), the lock will be unlocked. /// /// The main difference between `MappedMutexGuard` and [`MutexGuard`] is that the -/// former cannot be used with [`CondVar`], since that +/// former cannot be used with [`Condvar`], since that /// could introduce soundness issues if the locked object is modified by another /// thread while the `Mutex` is unlocked. /// @@ -233,7 +233,7 @@ unsafe impl Sync for MutexGuard<'_, T> {} /// /// [`map`]: MutexGuard::map /// [`try_map`]: MutexGuard::try_map -/// [`CondVar`]: crate::sync::CondVar +/// [`Condvar`]: crate::sync::Condvar #[must_use = "if unused the Mutex will immediately unlock"] #[must_not_suspend = "holding a MappedMutexGuard across suspend \ points can cause deadlocks, delays, \