core: Add task::spawn_sched

This function creates a new scheduler with a specified number of threads and
immediately executes a task on it. The scheduler is configured to terminate
when the task dies. This is the minimum API necessary to enable blocking C
calls.
This commit is contained in:
Brian Anderson
2012-02-07 18:34:04 -08:00
parent 2f4e7c157e
commit 35ba9715fa
3 changed files with 100 additions and 7 deletions

View File

@@ -438,7 +438,7 @@ rust_get_sched_id() {
}
extern "C" CDECL rust_sched_id
rust_new_sched(size_t threads) {
rust_new_sched(uintptr_t threads) {
rust_task *task = rust_task_thread::get_task();
A(task->thread, threads > 0,
"Can't create a scheduler with no threads, silly!");