diff options
| author | johnthagen <johnthagen@users.noreply.github.com> | 2017-10-11 07:33:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-11 07:33:46 -0400 |
| commit | 23a5fb811e3e0c76153c9161c7a6eedb2714b554 (patch) | |
| tree | 457cbc4e2d7f634750186f6fe200509ce71177b9 /src/libstd/thread | |
| parent | a263a78b28dd1cef60025b0681689d7b6188d693 (diff) | |
| parent | 264aafe0566e521bbc95bd3f44dae97591c9fd20 (diff) | |
| download | rust-23a5fb811e3e0c76153c9161c7a6eedb2714b554.tar.gz rust-23a5fb811e3e0c76153c9161c7a6eedb2714b554.zip | |
Merge branch 'master' into pep8-bootstrap
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 30887b16c60..07bbddc62b9 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -485,15 +485,17 @@ impl Builder { /// let (tx, rx) = channel(); /// /// let sender = thread::spawn(move || { -/// let _ = tx.send("Hello, thread".to_owned()); +/// tx.send("Hello, thread".to_owned()) +/// .expect("Unable to send on channel"); /// }); /// /// let receiver = thread::spawn(move || { -/// println!("{}", rx.recv().unwrap()); +/// let value = rx.recv().expect("Unable to receive from channel"); +/// println!("{}", value); /// }); /// -/// let _ = sender.join(); -/// let _ = receiver.join(); +/// sender.join().expect("The sender thread has panicked"); +/// receiver.join().expect("The receiver thread has panicked"); /// ``` /// /// A thread can also return a value through its [`JoinHandle`], you can use @@ -1192,7 +1194,7 @@ impl<T> JoinInner<T> { /// }); /// }); /// -/// let _ = original_thread.join(); +/// original_thread.join().expect("The thread being joined has panicked"); /// println!("Original thread is joined."); /// /// // We make sure that the new thread has time to run, before the main |
