src/pmc/coroutine.pmc - Co-Routine PMC


Coroutine extends Continuation to provide a subroutine that can stop in the middle, and start back up later at the point at which it stopped. See the Glossary for more information.

Flags ^

private0 call flip flop

private3 restore current sub after "flop". Used by generators.

Methods ^

void init()

Initializes the co-routine.

PMC *clone()

Clone the couroutine.

void destroy()

Destroys the coroutine.

opcode_t *invoke(void *next)

Swaps the "context".

void mark()

Marks the coroutine as live.