Skip to content

Commit 992dd20

Browse files
Add missing url in sync structs
1 parent 0823077 commit 992dd20

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

src/libstd/sys_common/poison.rs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@ pub struct Guard {
6060

6161
/// A type of error which can be returned whenever a lock is acquired.
6262
///
63-
/// Both Mutexes and RwLocks are poisoned whenever a thread fails while the lock
63+
/// Both [`Mutex`]es and [`RwLock`]s are poisoned whenever a thread fails while the lock
6464
/// is held. The precise semantics for when a lock is poisoned is documented on
6565
/// each lock, but once a lock is poisoned then all future acquisitions will
6666
/// return this error.
67+
///
68+
/// [`Mutex`]: ../../std/sync/struct.Mutex.html
69+
/// [`RwLock`]: ../../std/sync/struct.RwLock.html
6770
#[stable(feature = "rust1", since = "1.0.0")]
6871
pub struct PoisonError<T> {
6972
guard: T,
@@ -85,19 +88,26 @@ pub enum TryLockError<T> {
8588

8689
/// A type alias for the result of a lock method which can be poisoned.
8790
///
88-
/// The `Ok` variant of this result indicates that the primitive was not
89-
/// poisoned, and the `Guard` is contained within. The `Err` variant indicates
90-
/// that the primitive was poisoned. Note that the `Err` variant *also* carries
91-
/// the associated guard, and it can be acquired through the `into_inner`
91+
/// The [`Ok`] variant of this result indicates that the primitive was not
92+
/// poisoned, and the `Guard` is contained within. The [`Err`] variant indicates
93+
/// that the primitive was poisoned. Note that the [`Err`] variant *also* carries
94+
/// the associated guard, and it can be acquired through the [`into_inner`]
9295
/// method.
96+
///
97+
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
98+
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
99+
/// [`into_inner`]: ../../std/sync/struct.Mutex.html#method.into_inner
93100
#[stable(feature = "rust1", since = "1.0.0")]
94101
pub type LockResult<Guard> = Result<Guard, PoisonError<Guard>>;
95102

96103
/// A type alias for the result of a nonblocking locking method.
97104
///
98-
/// For more information, see `LockResult`. A `TryLockResult` doesn't
99-
/// necessarily hold the associated guard in the `Err` type as the lock may not
105+
/// For more information, see [`LockResult`]. A `TryLockResult` doesn't
106+
/// necessarily hold the associated guard in the [`Err`] type as the lock may not
100107
/// have been acquired for other reasons.
108+
///
109+
/// [`LockResult`]: ../../std/sync/type.LockResult.html
110+
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
101111
#[stable(feature = "rust1", since = "1.0.0")]
102112
pub type TryLockResult<Guard> = Result<Guard, TryLockError<Guard>>;
103113

@@ -124,6 +134,11 @@ impl<T> Error for PoisonError<T> {
124134

125135
impl<T> PoisonError<T> {
126136
/// Creates a `PoisonError`.
137+
///
138+
/// This is generally created by methods like [`Mutex::lock`] or [`RwLock::read`].
139+
///
140+
/// [`Mutex::lock`]: ../../std/sync/struct.Mutex.html#method.lock
141+
/// [`RwLock::read`]: ../../std/sync/struct.RwLock.html#method.read
127142
#[stable(feature = "sync_poison", since = "1.2.0")]
128143
pub fn new(guard: T) -> PoisonError<T> {
129144
PoisonError { guard: guard }

0 commit comments

Comments
 (0)