Auto merge of #25824 - alexcrichton:fix-deadlocking-test-on-windows, r=nikomatsakis
Windows tests can often deadlock if a child thread continues after the main thread and then panics, and a `println!` executed in a child thread after the main thread has exited is at risk of panicking.
This commit is contained in:
commit
1a3cffbddf
@ -8,15 +8,13 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(std_misc)]
|
||||
|
||||
use std::thread;
|
||||
|
||||
macro_rules! expr { ($e: expr) => { $e } }
|
||||
|
||||
macro_rules! spawn {
|
||||
($($code: tt)*) => {
|
||||
expr!(thread::spawn(move|| {$($code)*}))
|
||||
expr!(thread::spawn(move|| {$($code)*}).join())
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user