![]() |
EVE 1.0
|
![]() |
Modules | |
Local continuations | |
Protothread semaphores | |
Files | |
file | pt.h |
Initialization | |
#define | PT_INIT(pt) |
Declaration and definition | |
#define | PT_THREAD(name_args) |
#define | PT_BEGIN(pt) |
#define | PT_END(pt) |
Blocked wait | |
#define | PT_WAIT_UNTIL(pt, condition) |
#define | PT_WAIT_WHILE(pt, cond) |
Hierarchical protothreads | |
#define | PT_WAIT_THREAD(pt, thread) |
#define | PT_SPAWN(pt, child, thread) |
Exiting and restarting | |
#define | PT_RESTART(pt) |
#define | PT_EXIT(pt) |
Calling a protothread | |
#define | PT_SCHEDULE(f) |
Yielding from a protothread | |
#define | PT_YIELD(pt) |
#define | PT_YIELD_UNTIL(pt, cond) |
Yield from the protothread until a condition occurs. More... | |
#define PT_INIT | ( | pt | ) |
Initialize a protothread.
Initializes a protothread. Initialization must be done prior to starting to execute the protothread.
pt | A pointer to the protothread control structure. |
Definition at line 79 of file pt.h.
Referenced by process_start().
#define PT_THREAD | ( | name_args | ) |
#define PT_BEGIN | ( | pt | ) |
Declare the start of a protothread inside the C function implementing the protothread.
This macro is used to declare the starting point of a protothread. It should be placed at the start of the function in which the protothread runs. All C statements above the PT_BEGIN() invokation will be executed each time the protothread is scheduled.
pt | A pointer to the protothread control structure. |
#define PT_END | ( | pt | ) |
#define PT_WAIT_UNTIL | ( | pt, | |
condition | |||
) |
#define PT_WAIT_WHILE | ( | pt, | |
cond | |||
) |
#define PT_WAIT_THREAD | ( | pt, | |
thread | |||
) |
Block and wait until a child protothread completes.
This macro schedules a child protothread. The current protothread will block until the child protothread completes.
pt | A pointer to the protothread control structure. |
thread | The child protothread with arguments |
#define PT_SPAWN | ( | pt, | |
child, | |||
thread | |||
) |
Spawn a child protothread and wait until it exits.
This macro spawns a child protothread and waits until it exits. The macro can only be used within a protothread.
pt | A pointer to the protothread control structure. |
child | A pointer to the child protothread's control structure. |
thread | The child protothread with arguments |
#define PT_RESTART | ( | pt | ) |
#define PT_EXIT | ( | pt | ) |
#define PT_SCHEDULE | ( | f | ) |
#define PT_YIELD | ( | pt | ) |