about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-05-05 12:55:17 +0000
committerbors <bors@rust-lang.org>2015-05-05 12:55:17 +0000
commit58b83e7e740108611ad1e8286ee6b44ea5cbbb0f (patch)
treea8e355e9d1e1341eb70e35359d2dc8935a31258d
parentc0100ce84698dde68a25f05aa4271d84f547c50c (diff)
parent700cff5262e416372d048d2559af61f0492a4e48 (diff)
downloadrust-58b83e7e740108611ad1e8286ee6b44ea5cbbb0f.tar.gz
rust-58b83e7e740108611ad1e8286ee6b44ea5cbbb0f.zip
Auto merge of #25101 - alexcrichton:fix-flaky-windows-test, r=nikomatsakis
This test has deadlocked on Windows once or twice now and we've had lots of
problems in the past of threads panicking when the process is being shut down.
One of the two threads in this test is guaranteed to panic because of the
`.unwrap()` on the `send` calls, so just call `recv` on both receivers after the
test executes to ensure that both threads are dying/dead.
-rw-r--r--src/libstd/macros.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index 362296cd133..6a5e46e9ed0 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -152,12 +152,14 @@ macro_rules! try {
 /// thread::spawn(move|| { long_running_task(); tx1.send(()).unwrap(); });
 /// thread::spawn(move|| { tx2.send(calculate_the_answer()).unwrap(); });
 ///
-/// select! (
+/// select! {
 ///     _ = rx1.recv() => println!("the long running task finished first"),
 ///     answer = rx2.recv() => {
 ///         println!("the answer was: {}", answer.unwrap());
 ///     }
-/// )
+/// }
+/// # drop(rx1.recv());
+/// # drop(rx2.recv());
 /// ```
 ///
 /// For more information about select, see the `std::sync::mpsc::Select` structure.