Skip to content

Commit

Permalink
Rollup merge of #23534 - steveklabnik:remove_sched_threads, r=alexcri…
Browse files Browse the repository at this point in the history
…chton

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]
  • Loading branch information
Manishearth committed Mar 20, 2015
2 parents 0711006 + 71321ff commit 6107e4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/libstd/rt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 0 additions & 23 deletions src/libstd/rt/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 7 additions & 2 deletions src/libtest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#![feature(std_misc)]
#![feature(libc)]
#![feature(set_stdio)]
#![feature(os)]

extern crate getopts;
extern crate serialize;
Expand Down Expand Up @@ -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();
Expand All @@ -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()
}
}
}
}
Expand Down

0 comments on commit 6107e4c

Please sign in to comment.