about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-09-13 15:06:27 -0700
committerBrian Anderson <banderson@mozilla.com>2012-09-13 15:06:40 -0700
commit8a8ca1863dd91728d0e09be9775b83e4fd39a834 (patch)
treeeb20f8fe1b6cdc57fc8f69f88d6edee2dc773358 /src
parent43924f1f9ffea44390e178a97bef283cb7efbee1 (diff)
downloadrust-8a8ca1863dd91728d0e09be9775b83e4fd39a834.tar.gz
rust-8a8ca1863dd91728d0e09be9775b83e4fd39a834.zip
Fix broken test in core::task
Diffstat (limited to 'src')
-rw-r--r--src/libcore/task.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libcore/task.rs b/src/libcore/task.rs
index 2780836599e..441e821b81a 100644
--- a/src/libcore/task.rs
+++ b/src/libcore/task.rs
@@ -2425,10 +2425,14 @@ fn test_tls_cleanup_on_failure() unsafe {
 
 #[test]
 fn test_sched_thread_per_core() {
-    let cores = rustrt::rust_num_threads();
-    let mut reported_threads = 0u;
+    let (chan, port) = pipes::stream();
+
     do spawn_sched(ThreadPerCore) {
-        reported_threads = rustrt::sched_threads();
+        let cores = rustrt::rust_num_threads();
+        let reported_threads = rustrt::sched_threads();
+        assert(cores as uint == reported_threads as uint);
+        chan.send(());
     }
-    assert(cores == reported_threads);
+
+    port.recv();
 }