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.
This commit is contained in:
committed by
Brian Anderson
parent
35a9353774
commit
68e755b1c2
@@ -627,11 +627,17 @@ start_task(rust_task *target, fn_env_pair *f) {
|
||||
}
|
||||
|
||||
extern "C" CDECL size_t
|
||||
sched_threads() {
|
||||
rust_sched_threads() {
|
||||
rust_task *task = rust_get_current_task();
|
||||
return task->sched->number_of_threads();
|
||||
}
|
||||
|
||||
extern "C" CDECL size_t
|
||||
rust_max_sched_threads() {
|
||||
rust_task *task = rust_get_current_task();
|
||||
return task->sched->max_number_of_threads();
|
||||
}
|
||||
|
||||
extern "C" CDECL rust_port*
|
||||
rust_port_take(rust_port_id id) {
|
||||
rust_task *task = rust_get_current_task();
|
||||
|
||||
Reference in New Issue
Block a user