]> git.lizzy.rs Git - rust.git/commitdiff
Remove rt::default_sched_threads and RUST_THREADS.
authorSteve Klabnik <steve@steveklabnik.com>
Thu, 19 Mar 2015 22:38:16 +0000 (18:38 -0400)
committerManish Goregaokar <manishsmail@gmail.com>
Fri, 20 Mar 2015 00:06:07 +0000 (05:36 +0530)
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

src/libstd/rt/mod.rs
src/libstd/rt/util.rs
src/libtest/lib.rs

index 90cc189b9a0f0a3f8c4e93eb4945f9e740263dbb..5e8abfd0a3f8988a9f4a128e0bc233dd90b6aec8 100644 (file)
@@ -30,7 +30,7 @@
 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.
index e72fd7b33202dab64a063d2acb39ac67462e25b6..f1c43a07e6e3895ef35cc52369876cc8f0cc7350 100644 (file)
@@ -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,
index e4ccd49e807acfb1f803e25819ccb35c14a653ec..51decbab8587d1e516279ff98e05dccd3dd6ce91 100644 (file)
@@ -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()
+            }
         }
     }
 }