Skip to content

Commit 03c9510

Browse files
author
Felix Raimundo
committed
Fix typos in thread::park documentation.
1 parent fa0cdaa commit 03c9510

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/libstd/thread/mod.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ pub fn sleep(dur: Duration) {
518518
/// # park and unpark
519519
///
520520
/// Every thread is equipped with some basic low-level blocking support, via the
521-
/// [`thread::park`][`park`] function and [`thread::Thread::unpark()`][`unpark`]
521+
/// [`thread::park`][`park`] function and [`thread::Thread::unpark`][`unpark`]
522522
/// method. [`park`] blocks the current thread, which can then be resumed from
523523
/// another thread by calling the [`unpark`] method on the blocked thread's
524524
/// handle.
@@ -555,6 +555,7 @@ pub fn sleep(dur: Duration) {
555555
///
556556
/// ```
557557
/// use std::thread;
558+
/// use std::time::Duration;
558559
///
559560
/// let parked_thread = thread::Builder::new()
560561
/// .spawn(|| {
@@ -598,7 +599,7 @@ pub fn park() {
598599
/// Blocks unless or until the current thread's token is made available or
599600
/// the specified duration has been reached (may wake spuriously).
600601
///
601-
/// The semantics of this function are equivalent to [`park()`][park] except
602+
/// The semantics of this function are equivalent to [`park`][park] except
602603
/// that the thread will be blocked for roughly no longer than `dur`. This
603604
/// method should not be used for precise timing due to anomalies such as
604605
/// preemption or platform differences that may not cause the maximum
@@ -617,7 +618,7 @@ pub fn park_timeout_ms(ms: u32) {
617618
/// Blocks unless or until the current thread's token is made available or
618619
/// the specified duration has been reached (may wake spuriously).
619620
///
620-
/// The semantics of this function are equivalent to [`park()`][park] except
621+
/// The semantics of this function are equivalent to [`park`][park] except
621622
/// that the thread will be blocked for roughly no longer than `dur`. This
622623
/// method should not be used for precise timing due to anomalies such as
623624
/// preemption or platform differences that may not cause the maximum
@@ -780,7 +781,7 @@ impl Thread {
780781
/// Atomically makes the handle's token available if it is not already.
781782
///
782783
/// Every thread is equipped with some basic low-level blocking support, via
783-
/// the [`park()`][park] function and the `unpark()` method. These can be
784+
/// the [`park`][park] function and the `unpark()` method. These can be
784785
/// used as a more CPU-efficient implementation of a spinlock.
785786
///
786787
/// See the [park documentation][park] for more details.
@@ -789,6 +790,7 @@ impl Thread {
789790
///
790791
/// ```
791792
/// use std::thread;
793+
/// use std::time::Duration;
792794
///
793795
/// let parked_thread = thread::Builder::new()
794796
/// .spawn(|| {

0 commit comments

Comments
 (0)