diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-03-19 18:38:16 -0400 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-03-20 05:36:07 +0530 |
| commit | 71321ff33fa3fe71cc1df541b3d0547b4e208923 (patch) | |
| tree | fd701f6e9e786cffe42a7a84bbb949b2e60697fd | |
| parent | 7cbc42849f7586d3c567d7ac8f202839f9b968e8 (diff) | |
| download | rust-71321ff33fa3fe71cc1df541b3d0547b4e208923.tar.gz rust-71321ff33fa3fe71cc1df541b3d0547b4e208923.zip | |
Remove rt::default_sched_threads and RUST_THREADS.
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] Conflicts: src/libtest/lib.rs
| -rw-r--r-- | src/libstd/rt/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/util.rs | 23 | ||||
| -rw-r--r-- | src/libtest/lib.rs | 9 |
3 files changed, 8 insertions, 26 deletions
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 90cc189b9a0..5e8abfd0a3f 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -30,7 +30,7 @@ use thunk::Thunk; use usize; // Reexport some of our utilities which are expected by other crates. -pub use self::util::{default_sched_threads, min_stack, running_on_valgrind}; +pub use self::util::{min_stack, running_on_valgrind}; pub use self::unwind::{begin_unwind, begin_unwind_fmt}; // Reexport some functionality from liballoc. diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs index e72fd7b3320..f1c43a07e6e 100644 --- a/src/libstd/rt/util.rs +++ b/src/libstd/rt/util.rs @@ -58,29 +58,6 @@ pub fn min_stack() -> uint { return amt; } -/// Get's the number of scheduler threads requested by the environment -/// either `RUST_THREADS` or `num_cpus`. -#[allow(deprecated)] -pub fn default_sched_threads() -> uint { - use os; - match env::var("RUST_THREADS") { - Ok(nstr) => { - let opt_n: Option<uint> = nstr.parse().ok(); - match opt_n { - Some(n) if n > 0 => n, - _ => panic!("`RUST_THREADS` is `{}`, should be a positive integer", nstr) - } - } - Err(..) => { - if limit_thread_creation_due_to_osx_and_valgrind() { - 1 - } else { - os::num_cpus() - } - } - } -} - // Indicates whether we should perform expensive sanity checks, including rtassert! // // FIXME: Once the runtime matures remove the `true` below to turn off rtassert, 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() + } } } } |
