Skip to content

Commit d9628f9

Browse files
author
Felix Raimundo
committed
Add park info to unpark.
- Adds an explanantion of what `park` does in the `unpark` documentation. - Adds a link to the module doc.
1 parent c158962 commit d9628f9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/libstd/thread/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,11 @@ impl Thread {
768768

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

0 commit comments

Comments
 (0)