File tree 3 files changed +8
-26
lines changed
3 files changed +8
-26
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ use thunk::Thunk;
30
30
use usize;
31
31
32
32
// 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} ;
34
34
pub use self :: unwind:: { begin_unwind, begin_unwind_fmt} ;
35
35
36
36
// Reexport some functionality from liballoc.
Original file line number Diff line number Diff line change @@ -58,29 +58,6 @@ pub fn min_stack() -> uint {
58
58
return amt;
59
59
}
60
60
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
-
84
61
// Indicates whether we should perform expensive sanity checks, including rtassert!
85
62
//
86
63
// FIXME: Once the runtime matures remove the `true` below to turn off rtassert,
Original file line number Diff line number Diff line change 44
44
#![ feature( std_misc) ]
45
45
#![ feature( libc) ]
46
46
#![ feature( set_stdio) ]
47
+ #![ feature( os) ]
47
48
48
49
extern crate getopts;
49
50
extern crate serialize;
@@ -841,8 +842,8 @@ fn run_tests<F>(opts: &TestOpts,
841
842
Ok ( ( ) )
842
843
}
843
844
845
+ #[ allow( deprecated) ]
844
846
fn get_concurrency ( ) -> uint {
845
- use std:: rt;
846
847
match env:: var ( "RUST_TEST_THREADS" ) {
847
848
Ok ( s) => {
848
849
let opt_n: Option < uint > = s. parse ( ) . ok ( ) ;
@@ -852,7 +853,11 @@ fn get_concurrency() -> uint {
852
853
}
853
854
}
854
855
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
+ }
856
861
}
857
862
}
858
863
}
You can’t perform that action at this time.
0 commit comments