Skip to content

Commit 08480e4

Browse files
committed
std: Remove ExistingScheduler spawn mode. Unused
1 parent 5d2b8d4 commit 08480e4

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

src/libstd/task/mod.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use result::Result;
4444
use result;
4545
use rt::{context, OldTaskContext, TaskContext};
4646
use rt::local::Local;
47-
use task::rt::{task_id, sched_id};
47+
use task::rt::task_id;
4848
use unstable::finally::Finally;
4949
use util;
5050

@@ -58,12 +58,6 @@ mod local_data_priv;
5858
pub mod rt;
5959
pub mod spawn;
6060

61-
/// A handle to a scheduler
62-
#[deriving(Eq)]
63-
pub enum Scheduler {
64-
SchedulerHandle(sched_id)
65-
}
66-
6761
/// A handle to a task
6862
#[deriving(Eq)]
6963
pub enum Task {
@@ -94,8 +88,6 @@ pub enum SchedMode {
9488
DefaultScheduler,
9589
/// Run task on the current scheduler
9690
CurrentScheduler,
97-
/// Run task on a specific scheduler
98-
ExistingScheduler(Scheduler),
9991
/// All tasks run in the same OS thread
10092
SingleThreaded,
10193
}
@@ -588,10 +580,6 @@ pub fn get_task() -> Task {
588580
}
589581
}
590582

591-
pub fn get_scheduler() -> Scheduler {
592-
SchedulerHandle(unsafe { rt::rust_get_sched_id() })
593-
}
594-
595583
/**
596584
* Temporarily make the task unkillable
597585
*

src/libstd/task/spawn.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ use task::rt::rust_task;
8686
use task::rt;
8787
use task::{Failure, SchedOpts, SingleThreaded};
8888
use task::{Success, TaskOpts, TaskResult};
89-
use task::{ExistingScheduler, SchedulerHandle};
9089
use task::unkillable;
9190
use to_bytes::IterBytes;
9291
use uint;
@@ -807,15 +806,13 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) {
807806

808807
let num_threads = match opts.mode {
809808
DefaultScheduler
810-
| CurrentScheduler
811-
| ExistingScheduler(*) => 0u, /* Won't be used */
809+
| CurrentScheduler => 0u, /* Won't be used */
812810
SingleThreaded => 1u,
813811
};
814812

815813
unsafe {
816814
let sched_id = match opts.mode {
817815
CurrentScheduler => rt::rust_get_sched_id(),
818-
ExistingScheduler(SchedulerHandle(id)) => id,
819816
_ => rt::rust_new_sched(num_threads)
820817
};
821818
rt::rust_new_task_in_sched(sched_id)

0 commit comments

Comments
 (0)