diff options
| author | Felix Raimundo <felix.raimundo@tweag.io> | 2017-05-07 21:43:46 +0200 |
|---|---|---|
| committer | Felix Raimundo <felix.raimundo@tweag.io> | 2017-05-07 21:50:44 +0200 |
| commit | 03c9510525c986715af1f1f98c2bc06248c747e8 (patch) | |
| tree | 569d27de5bb676c5075907da26785325fe25d503 /src/libstd/thread/mod.rs | |
| parent | fa0cdaa63f575c81c7cc87239f7dfcc677362c78 (diff) | |
| download | rust-03c9510525c986715af1f1f98c2bc06248c747e8.tar.gz rust-03c9510525c986715af1f1f98c2bc06248c747e8.zip | |
Fix typos in `thread::park` documentation.
Diffstat (limited to 'src/libstd/thread/mod.rs')
| -rw-r--r-- | src/libstd/thread/mod.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 5373bf273d4..4d931682676 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -518,7 +518,7 @@ pub fn sleep(dur: Duration) { /// # park and unpark /// /// Every thread is equipped with some basic low-level blocking support, via the -/// [`thread::park`][`park`] function and [`thread::Thread::unpark()`][`unpark`] +/// [`thread::park`][`park`] function and [`thread::Thread::unpark`][`unpark`] /// method. [`park`] blocks the current thread, which can then be resumed from /// another thread by calling the [`unpark`] method on the blocked thread's /// handle. @@ -555,6 +555,7 @@ pub fn sleep(dur: Duration) { /// /// ``` /// use std::thread; +/// use std::time::Duration; /// /// let parked_thread = thread::Builder::new() /// .spawn(|| { @@ -598,7 +599,7 @@ pub fn park() { /// Blocks unless or until the current thread's token is made available or /// the specified duration has been reached (may wake spuriously). /// -/// The semantics of this function are equivalent to [`park()`][park] except +/// The semantics of this function are equivalent to [`park`][park] except /// that the thread will be blocked for roughly no longer than `dur`. This /// method should not be used for precise timing due to anomalies such as /// preemption or platform differences that may not cause the maximum @@ -617,7 +618,7 @@ pub fn park_timeout_ms(ms: u32) { /// Blocks unless or until the current thread's token is made available or /// the specified duration has been reached (may wake spuriously). /// -/// The semantics of this function are equivalent to [`park()`][park] except +/// The semantics of this function are equivalent to [`park`][park] except /// that the thread will be blocked for roughly no longer than `dur`. This /// method should not be used for precise timing due to anomalies such as /// preemption or platform differences that may not cause the maximum @@ -780,7 +781,7 @@ impl Thread { /// Atomically makes the handle's token available if it is not already. /// /// Every thread is equipped with some basic low-level blocking support, via - /// the [`park()`][park] function and the `unpark()` method. These can be + /// the [`park`][park] function and the `unpark()` method. These can be /// used as a more CPU-efficient implementation of a spinlock. /// /// See the [park documentation][park] for more details. @@ -789,6 +790,7 @@ impl Thread { /// /// ``` /// use std::thread; + /// use std::time::Duration; /// /// let parked_thread = thread::Builder::new() /// .spawn(|| { |
