#include <coroutine_decls.h>
Inheritance diagram for Coroutine:
Public Member Functions | |
Coroutine () | |
Constructs a Coroutine. | |
void | acquire () throw () |
Acquires this coroutine before a swapto() or returnto() when other datastructures need to be modified. | |
void | release () throw () |
Releases this coroutine. | |
void | swapto (Coroutine &o, bool acquired=false) |
Swaps the context from this coroutine to the given coroutine. | |
Protected Member Functions | |
virtual void | destroyme () |
Internal function return interface. | |
Protected Attributes | |
ucontext_t | context |
Internal context datastructure. | |
Friends | |
class | NewCoroutine |
Coroutine::Coroutine | ( | ) |
Constructs a Coroutine.
Note that the calling thread must invoke the acquire method prior using the coroutine with swapto.
void Coroutine::destroyme | ( | ) | [protected, virtual] |
Internal function return interface.
Do not use.
void Coroutine::acquire | ( | ) | throw () [inline] |
void Coroutine::release | ( | ) | throw () [inline] |
Releases this coroutine.
This method must be called before destructing a Coroutine, but after having ensured that noone else modifies it.
void Coroutine::swapto | ( | Coroutine & | o, | |
bool | acquired = false | |||
) |
Swaps the context from this coroutine to the given coroutine.
o | is the coroutine being swapped to | |
acquired | must be true if this object was previously acquired using acquire() |
ucontext_t Coroutine::context [protected] |
Internal context datastructure.
It is not private because it is accessed in NewCoroutine.