about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-25 06:45:07 -0700
committerGitHub <noreply@github.com>2016-06-25 06:45:07 -0700
commitb8214dc6c6fc20d0a660fb5700dca9ebf51ebe89 (patch)
treed5ece377c063ee50f99d8a4b4547cc38e3675489 /src/libstd
parent35004b42bcd932222a4a58bf49d0d094ba397664 (diff)
parent77b6a647bc0172fadf18413bbdf0ea5d0fba13b2 (diff)
downloadrust-b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89.tar.gz
rust-b8214dc6c6fc20d0a660fb5700dca9ebf51ebe89.zip
Auto merge of #34464 - Manishearth:rollup, r=Manishearth
Rollup of 8 pull requests

- Successful merges: #34379, #34406, #34411, #34414, #34435, #34438, #34445, #34449
- Failed merges:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/thread/mod.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index d83d45518e4..e68e525b4ac 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -610,6 +610,36 @@ impl<T> JoinInner<T> {
 /// Due to platform restrictions, it is not possible to `Clone` this
 /// handle: the ability to join a child thread is a uniquely-owned
 /// permission.
+///
+/// This `struct` is created by the [`thread::spawn`] function and the
+/// [`thread::Builder::spawn`] method.
+///
+/// # Examples
+///
+/// Creation from [`thread::spawn`]:
+///
+/// ```rust
+/// use std::thread;
+///
+/// let join_handle: thread::JoinHandle<_> = thread::spawn(|| {
+///     // some work here
+/// });
+/// ```
+///
+/// Creation from [`thread::Builder::spawn`]:
+///
+/// ```rust
+/// use std::thread;
+///
+/// let builder = thread::Builder::new();
+///
+/// let join_handle: thread::JoinHandle<_> = builder.spawn(|| {
+///     // some work here
+/// }).unwrap();
+/// ```
+///
+/// [`thread::spawn`]: fn.spawn.html
+/// [`thread::Builder::spawn`]: struct.Builder.html#method.spawn
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct JoinHandle<T>(JoinInner<T>);