about summary refs log tree commit diff
path: root/src/libtest
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtest')
-rw-r--r--src/libtest/lib.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index e4ccd49e807..51decbab858 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -44,6 +44,7 @@
 #![feature(std_misc)]
 #![feature(libc)]
 #![feature(set_stdio)]
+#![feature(os)]
 
 extern crate getopts;
 extern crate serialize;
@@ -841,8 +842,8 @@ fn run_tests<F>(opts: &TestOpts,
     Ok(())
 }
 
+#[allow(deprecated)]
 fn get_concurrency() -> uint {
-    use std::rt;
     match env::var("RUST_TEST_THREADS") {
         Ok(s) => {
             let opt_n: Option<uint> = s.parse().ok();
@@ -852,7 +853,11 @@ fn get_concurrency() -> uint {
             }
         }
         Err(..) => {
-            rt::default_sched_threads()
+            if std::rt::util::limit_thread_creation_due_to_osx_and_valgrind() {
+                1
+            } else {
+                std::os::num_cpus()
+            }
         }
     }
 }