about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2012-09-14 15:01:17 +0200
committerBrian Anderson <banderson@mozilla.com>2012-09-19 14:01:53 -0700
commit68e755b1c26db09cf8e121bbbea2075f6116e279 (patch)
tree8d48dc089bb9effd2090117fd6033c4ca81470d1 /src/libstd
parent35a935377483823ca1fbaede5a87406b494b0488 (diff)
core: Allocate threads on demand, not on scheduler startup
API change: rust_kernel::create_scheduler() or
rust_scheduler::rust_scheduler() respecitevly now take ownership of the
launch factory argument, it is needed to create new threads on demand.

Also renames rustrt::sched_threads() to rustrt::rust_sched_threads() for
consistency. Added rustrt::rust_max_sched_threads() to return the
maximal number of scheduled threads of the current scheduler.

Fixes #3493.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/test.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/test.rs b/src/libstd/test.rs
index 8692a9a440a..ad0003934e4 100644
--- a/src/libstd/test.rs
+++ b/src/libstd/test.rs
@@ -26,7 +26,7 @@ export run_tests_console;
 
 #[abi = "cdecl"]
 extern mod rustrt {
-    fn sched_threads() -> libc::size_t;
+    fn rust_max_sched_threads() -> libc::size_t;
 }
 
 // The name of a test. By convention this follows the rules for rust
@@ -327,7 +327,7 @@ const sched_overcommit : uint = 1u;
 const sched_overcommit : uint = 4u;
 
 fn get_concurrency() -> uint {
-    let threads = rustrt::sched_threads() as uint;
+    let threads = rustrt::rust_max_sched_threads() as uint;
     if threads == 1u { 1u }
     else { threads * sched_overcommit }
 }