Struct green::context::Context[src]

pub struct Context {
    // some fields omitted
}

Methods

impl Context

fn empty() -> Context

fn new(init: InitFn, arg: uint, start: proc(): Send, stack: &mut Stack) -> Context

Create a new context that will resume execution by running proc()

The init function will be run with arg and the start procedure split up into code and env pointers. It is required that the init function never return.

FIXME: this is basically an awful the interface. The main reason for this is to reduce the number of allocations made when a green task is spawned as much as possible

fn swap(out_context: &mut Context, in_context: &Context)