From 68e755b1c26db09cf8e121bbbea2075f6116e279 Mon Sep 17 00:00:00 2001 From: Philipp Brüschweiler Date: Fri, 14 Sep 2012 15:01:17 +0200 Subject: 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. --- src/libstd/test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd') 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 } } -- cgit 1.4.1-3-g733a5