Struct green::task::GreenTaskExperimental
[-]
[+]
[src]
pub struct GreenTask {
pub coroutine: Option<Coroutine>,
pub handle: Option<SchedHandle>,
pub sched: Option<Box<Scheduler>>,
pub task: Option<Box<Task>>,
pub task_type: TaskType,
pub pool_id: uint,
pub nasty_deschedule_lock: NativeMutex,
}The necessary fields needed to keep track of a green task (as opposed to a 1:1 task).
Fields
Methods
impl GreenTask
fn new(stack_pool: &mut StackPool, stack_size: Option<uint>, start: proc(): Send) -> Box<GreenTask>
Creates a new green task which is not homed to any particular scheduler and will not have any contained Task structure.
fn new_homed(stack_pool: &mut StackPool, stack_size: Option<uint>, home: Home, start: proc(): Send) -> Box<GreenTask>
Creates a new task (like new), but specifies the home for new task.
fn new_typed(coroutine: Option<Coroutine>, task_type: TaskType) -> Box<GreenTask>
Creates a new green task with the specified coroutine and type, this is useful when creating scheduler tasks.
fn configure(pool: &mut StackPool, opts: TaskOpts, f: proc(): Send) -> Box<GreenTask>
Creates a new green task with the given configuration options for the contained Task object. The given stack pool is also used to allocate a new stack for this task.
fn convert(task: Box<Task>) -> Box<GreenTask>
Just like the maybe_take_runtime function, this function should not
exist. Usage of this function is strongly discouraged. This is an
absolute last resort necessary for converting a libstd task to a green
task.
This function will assert that the task is indeed a green task before returning (and will kill the entire process if this is wrong).