Skip to content

Commit

Permalink
Add park info to unpark.
Browse files Browse the repository at this point in the history
- Adds an explanantion of what `park` does in the `unpark` documentation.
- Adds a link to the module doc.
  • Loading branch information
Felix Raimundo committed May 7, 2017
1 parent c158962 commit d9628f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/libstd/thread/mod.rs
Expand Up @@ -768,7 +768,11 @@ impl Thread {

/// Atomically makes the handle's token available if it is not already.
///
/// See the module doc for more detail.
/// Every thread is equipped with some basic low-level blocking support, via
/// the [`park()`][park] function and the `unpark` method. These can be
/// used as a more CPU-efficient implementation of a spinlock.
///
/// See the [module doc][thread] for more detail.
///
/// # Examples
///
Expand All @@ -784,6 +788,9 @@ impl Thread {
///
/// handler.join().unwrap();
/// ```
///
/// [thread]: index.html
/// [park]: fn.park.html
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unpark(&self) {
let mut guard = self.inner.lock.lock().unwrap();
Expand Down

0 comments on commit d9628f9

Please sign in to comment.