Skip to content

Commit fa38403

Browse files
committed
alloc: Don't run some Arc doc tests
Windows gets quite unhappy when a thread fails while the main thread is exiting, frequently leading to process deadlock. This has been causing quite a few deadlocks on the windows bots recently. The child threads are presumably failing because the `println!` is failing due to the main thread being shut down.
1 parent 199bdcf commit fa38403

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/liballoc/arc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
//!
3434
//! Sharing some immutable data between tasks:
3535
//!
36-
//! ```
36+
//! ```no_run
3737
//! use std::sync::Arc;
3838
//! use std::thread;
3939
//!
@@ -50,7 +50,7 @@
5050
//!
5151
//! Sharing mutable data safely between tasks with a `Mutex`:
5252
//!
53-
//! ```
53+
//! ```no_run
5454
//! use std::sync::{Arc, Mutex};
5555
//! use std::thread;
5656
//!

src/test/run-pass/spawn-fn.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,21 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(std_misc)]
11+
use std::thread;
1212

13-
use std::thread::Thread;
14-
15-
fn x(s: String, n: int) {
13+
fn x(s: String, n: isize) {
1614
println!("{}", s);
1715
println!("{}", n);
1816
}
1917

2018
pub fn main() {
21-
let _t = Thread::spawn(|| x("hello from first spawned fn".to_string(), 65) );
22-
let _t = Thread::spawn(|| x("hello from second spawned fn".to_string(), 66) );
23-
let _t = Thread::spawn(|| x("hello from third spawned fn".to_string(), 67) );
24-
let mut i: int = 30;
19+
let _t = thread::scoped(|| x("hello from first spawned fn".to_string(), 65) );
20+
let _t = thread::scoped(|| x("hello from second spawned fn".to_string(), 66) );
21+
let _t = thread::scoped(|| x("hello from third spawned fn".to_string(), 67) );
22+
let mut i = 30;
2523
while i > 0 {
2624
i = i - 1;
2725
println!("parent sleeping");
28-
Thread::yield_now();
26+
thread::yield_now();
2927
}
3028
}

0 commit comments

Comments
 (0)