Skip to content

Commit 8a8ca18

Browse files
committed
Fix broken test in core::task
1 parent 43924f1 commit 8a8ca18

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/libcore/task.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,10 +2425,14 @@ fn test_tls_cleanup_on_failure() unsafe {
24252425

24262426
#[test]
24272427
fn test_sched_thread_per_core() {
2428-
let cores = rustrt::rust_num_threads();
2429-
let mut reported_threads = 0u;
2428+
let (chan, port) = pipes::stream();
2429+
24302430
do spawn_sched(ThreadPerCore) {
2431-
reported_threads = rustrt::sched_threads();
2431+
let cores = rustrt::rust_num_threads();
2432+
let reported_threads = rustrt::sched_threads();
2433+
assert(cores as uint == reported_threads as uint);
2434+
chan.send(());
24322435
}
2433-
assert(cores == reported_threads);
2436+
2437+
port.recv();
24342438
}

0 commit comments

Comments
 (0)