about summary refs log tree commit diff
path: root/src/libstd/thread/mod.rs
diff options
context:
space:
mode:
authorFelix Raimundo <felix.raimundo@tweag.io>2017-05-07 13:54:06 +0200
committerFelix Raimundo <felix.raimundo@tweag.io>2017-05-07 13:54:06 +0200
commitd9628f9389319c1075d4a54a0a490226539cea81 (patch)
tree71f683615302fad51f4add1411d031a8196de8c8 /src/libstd/thread/mod.rs
parentc158962169e3cf0686cb70652282bcdf20772926 (diff)
downloadrust-d9628f9389319c1075d4a54a0a490226539cea81.tar.gz
rust-d9628f9389319c1075d4a54a0a490226539cea81.zip
Add `park` info to `unpark`.
- Adds an explanantion of what `park` does in the `unpark` documentation.
- Adds a link to the module doc.
Diffstat (limited to 'src/libstd/thread/mod.rs')
-rw-r--r--src/libstd/thread/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index 1857f81a339..bdf7b1134bf 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -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
     ///
@@ -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();