fn on_appropriate_sched() -> bool {
                use task::{TypeGreen, TypeSched, HomeSched};
                let task = GreenTask::convert(Local::take());
                let sched_id = task.sched.get_ref().sched_id();
                let run_any = task.sched.get_ref().run_anything;
                let ret = match task.task_type {
                    TypeGreen(Some(AnySched)) => {
                        run_any
                    }
                    TypeGreen(Some(HomeSched(SchedHandle {
                        sched_id: ref id,
                        ..
                    }))) => {
                        *id == sched_id
                    }
                    TypeGreen(None) => { fail!("task without home"); }
                    TypeSched => { fail!("expected green task"); }
                };
                task.put();
                ret
            }
// Grab both the scheduler and the task from TLS and check if the
// task is executing on an appropriate scheduler.
Grab both the scheduler and the task from TLS and check if the
task is executing on an appropriate scheduler.
Grab both the scheduler and the task from TLS and check if the task is executing on an appropriate scheduler .
fn on_appropriate_sched() -> bool {
                use task::{TypeGreen, TypeSched, HomeSched};
                let task = GreenTask::convert(Local::take());
                let sched_id = task.sched.get_ref().sched_id();
                let run_any = task.sched.get_ref().run_anything;
                let ret = match task.task_type {
                    TypeGreen(Some(AnySched)) => {
                        run_any
                    }
                    TypeGreen(Some(HomeSched(SchedHandle {
                        sched_id: ref id,
                        ..
                    }))) => {
                        *id == sched_id
                    }
                    TypeGreen(None) => { fail!("task without home"); }
                    TypeSched => { fail!("expected green task"); }
                };
                task.put();
                ret
            }
fn on_appropriate_sched ( ) -> bool { use task :: { TypeGreen , TypeSched , HomeSched } ; let task = GreenTask :: convert ( Local :: take ( ) ) ; let sched_id = task . sched . get_ref ( ) . sched_id ( ) ; let run_any = task . sched . get_ref ( ) . run_anything ; let ret = match task . task_type { TypeGreen ( Some ( AnySched ) ) => { run_any } TypeGreen ( Some ( HomeSched ( SchedHandle { sched_id : ref id , .. } ) ) ) => { * id == sched_id } TypeGreen ( None ) => { fail ! ( " " ) ; } TypeSched => { fail ! ( " " ) ; } } ; task . put ( ) ; ret }
Grab both the scheduler and the task from TLS and check if the
task is executing on an appropriate scheduler.
Grab both the scheduler and the task from TLS and check if the task is executing on an appropriate scheduler .