File tree Expand file tree Collapse file tree 3 files changed +8
-26
lines changed Expand file tree Collapse file tree 3 files changed +8
-26
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ use thunk::Thunk;
3030use usize;
3131
3232// Reexport some of our utilities which are expected by other crates.
33- pub use self :: util:: { default_sched_threads , min_stack, running_on_valgrind} ;
33+ pub use self :: util:: { min_stack, running_on_valgrind} ;
3434pub use self :: unwind:: { begin_unwind, begin_unwind_fmt} ;
3535
3636// Reexport some functionality from liballoc.
Original file line number Diff line number Diff line change @@ -58,29 +58,6 @@ pub fn min_stack() -> uint {
5858 return amt;
5959}
6060
61- /// Get's the number of scheduler threads requested by the environment
62- /// either `RUST_THREADS` or `num_cpus`.
63- #[ allow( deprecated) ]
64- pub fn default_sched_threads ( ) -> uint {
65- use os;
66- match env:: var ( "RUST_THREADS" ) {
67- Ok ( nstr) => {
68- let opt_n: Option < uint > = nstr. parse ( ) . ok ( ) ;
69- match opt_n {
70- Some ( n) if n > 0 => n,
71- _ => panic ! ( "`RUST_THREADS` is `{}`, should be a positive integer" , nstr)
72- }
73- }
74- Err ( ..) => {
75- if limit_thread_creation_due_to_osx_and_valgrind ( ) {
76- 1
77- } else {
78- os:: num_cpus ( )
79- }
80- }
81- }
82- }
83-
8461// Indicates whether we should perform expensive sanity checks, including rtassert!
8562//
8663// FIXME: Once the runtime matures remove the `true` below to turn off rtassert,
Original file line number Diff line number Diff line change 4444#![ feature( std_misc) ]
4545#![ feature( libc) ]
4646#![ feature( set_stdio) ]
47+ #![ feature( os) ]
4748
4849extern crate getopts;
4950extern crate serialize;
@@ -841,8 +842,8 @@ fn run_tests<F>(opts: &TestOpts,
841842 Ok ( ( ) )
842843}
843844
845+ #[ allow( deprecated) ]
844846fn get_concurrency ( ) -> uint {
845- use std:: rt;
846847 match env:: var ( "RUST_TEST_THREADS" ) {
847848 Ok ( s) => {
848849 let opt_n: Option < uint > = s. parse ( ) . ok ( ) ;
@@ -852,7 +853,11 @@ fn get_concurrency() -> uint {
852853 }
853854 }
854855 Err ( ..) => {
855- rt:: default_sched_threads ( )
856+ if std:: rt:: util:: limit_thread_creation_due_to_osx_and_valgrind ( ) {
857+ 1
858+ } else {
859+ std:: os:: num_cpus ( )
860+ }
856861 }
857862 }
858863}
You can’t perform that action at this time.
0 commit comments