Skip to content

Commit 6107e4c

Browse files
committed
Rollup merge of #23534 - steveklabnik:remove_sched_threads, r=alexcrichton
As @alexcrichton says, this was really a libgreen thing, and isn't relevant now. As this removes a technically-public function, this is a [breaking-change]
2 parents 0711006 + 71321ff commit 6107e4c

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

src/libstd/rt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use thunk::Thunk;
3030
use 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};
3434
pub use self::unwind::{begin_unwind, begin_unwind_fmt};
3535

3636
// Reexport some functionality from liballoc.

src/libstd/rt/util.rs

-23
Original file line numberDiff line numberDiff 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,

src/libtest/lib.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#![feature(std_misc)]
4545
#![feature(libc)]
4646
#![feature(set_stdio)]
47+
#![feature(os)]
4748

4849
extern crate getopts;
4950
extern crate serialize;
@@ -841,8 +842,8 @@ fn run_tests<F>(opts: &TestOpts,
841842
Ok(())
842843
}
843844

845+
#[allow(deprecated)]
844846
fn 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
}

0 commit comments

Comments
 (0)