std: Remove ExistingScheduler spawn mode. Unused
This commit is contained in:
parent
5d2b8d4372
commit
08480e4fda
@ -44,7 +44,7 @@
|
||||
use result;
|
||||
use rt::{context, OldTaskContext, TaskContext};
|
||||
use rt::local::Local;
|
||||
use task::rt::{task_id, sched_id};
|
||||
use task::rt::task_id;
|
||||
use unstable::finally::Finally;
|
||||
use util;
|
||||
|
||||
@ -58,12 +58,6 @@
|
||||
pub mod rt;
|
||||
pub mod spawn;
|
||||
|
||||
/// A handle to a scheduler
|
||||
#[deriving(Eq)]
|
||||
pub enum Scheduler {
|
||||
SchedulerHandle(sched_id)
|
||||
}
|
||||
|
||||
/// A handle to a task
|
||||
#[deriving(Eq)]
|
||||
pub enum Task {
|
||||
@ -94,8 +88,6 @@ pub enum SchedMode {
|
||||
DefaultScheduler,
|
||||
/// Run task on the current scheduler
|
||||
CurrentScheduler,
|
||||
/// Run task on a specific scheduler
|
||||
ExistingScheduler(Scheduler),
|
||||
/// All tasks run in the same OS thread
|
||||
SingleThreaded,
|
||||
}
|
||||
@ -588,10 +580,6 @@ pub fn get_task() -> Task {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_scheduler() -> Scheduler {
|
||||
SchedulerHandle(unsafe { rt::rust_get_sched_id() })
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporarily make the task unkillable
|
||||
*
|
||||
|
@ -86,7 +86,6 @@
|
||||
use task::rt;
|
||||
use task::{Failure, SchedOpts, SingleThreaded};
|
||||
use task::{Success, TaskOpts, TaskResult};
|
||||
use task::{ExistingScheduler, SchedulerHandle};
|
||||
use task::unkillable;
|
||||
use to_bytes::IterBytes;
|
||||
use uint;
|
||||
@ -807,15 +806,13 @@ fn new_task_in_sched(opts: SchedOpts) -> *rust_task {
|
||||
|
||||
let num_threads = match opts.mode {
|
||||
DefaultScheduler
|
||||
| CurrentScheduler
|
||||
| ExistingScheduler(*) => 0u, /* Won't be used */
|
||||
| CurrentScheduler => 0u, /* Won't be used */
|
||||
SingleThreaded => 1u,
|
||||
};
|
||||
|
||||
unsafe {
|
||||
let sched_id = match opts.mode {
|
||||
CurrentScheduler => rt::rust_get_sched_id(),
|
||||
ExistingScheduler(SchedulerHandle(id)) => id,
|
||||
_ => rt::rust_new_sched(num_threads)
|
||||
};
|
||||
rt::rust_new_task_in_sched(sched_id)
|
||||
|
Loading…
Reference in New Issue
Block a user