#include <suspender_decls.h>
Inheritance diagram for Suspender< T >:
Public Member Functions | |
T | suspend () |
Suspends the current Microthread until another Microthread invokes the wakeup() method. | |
bool | wakeup (const T &rv) |
Tries to wake the suspended Microthread with rv as return value. | |
bool | cooperativewakeup (const T &rv) |
Does the same as wakeup() with a direct context switch. | |
bool | issuspended () const |
Checks whether a Microthread is currently suspended by this Suspender. | |
bool | iswakened () const |
Checks whether wakeup() was called. | |
bool | iscompleted () const |
Checks whether both suspend() and wakeup() are called. | |
Static Public Member Functions | |
static Suspender & | create () |
This method wraps the constructor to make sure new is used. |
A Microthread gives references to Suspender objects to other Microthread and invokes the suspend() method. The first Microthread that invokes the wakeup(object) method wakes the suspended Microthread. All other calls are ignored.
T Suspender< T >::suspend | ( | ) |
Suspends the current Microthread until another Microthread invokes the wakeup() method.
bool Suspender< T >::wakeup | ( | const T & | rv | ) |
Tries to wake the suspended Microthread with rv as return value.
rv | is returned by suspend() in the suspended Microthread |
bool Suspender< T >::cooperativewakeup | ( | const T & | rv | ) |
Does the same as wakeup() with a direct context switch.
rv | is returned by suspend() in the suspended Microthread |
bool Suspender< T >::issuspended | ( | ) | const [inline] |
Checks whether a Microthread is currently suspended by this Suspender.
bool Suspender< T >::iswakened | ( | ) | const [inline] |
bool Suspender< T >::iscompleted | ( | ) | const [inline] |
Checks whether both suspend() and wakeup() are called.