IoTivity-Lite
pt.h File Reference

Protothreads implementation. More...

#include "lc.h"

Macros

#define PT_ENDED   3
 
#define PT_EXITED   2
 
#define PT_WAITING   0
 
#define PT_YIELDED   1
 
Initialization
#define PT_INIT(pt)
 Initialize a protothread. More...
 
Declaration and definition
#define PT_BEGIN(pt)
 Declare the start of a protothread inside the C function implementing the protothread. More...
 
#define PT_END(pt)
 Declare the end of a protothread. More...
 
#define PT_THREAD(name_args)
 Declaration of a protothread. More...
 
Blocked wait
#define PT_WAIT_UNTIL(pt, condition)
 Block and wait until condition is true. More...
 
#define PT_WAIT_WHILE(pt, cond)
 Block and wait while condition is true. More...
 
Hierarchical protothreads
#define PT_SPAWN(pt, child, thread)
 Spawn a child protothread and wait until it exits. More...
 
#define PT_WAIT_THREAD(pt, thread)
 Block and wait until a child protothread completes. More...
 
Exiting and restarting
#define PT_EXIT(pt)
 Exit the protothread. More...
 
#define PT_RESTART(pt)
 Restart the protothread. More...
 
Calling a protothread
#define PT_SCHEDULE(f)
 Schedule a protothread. More...
 
Yielding from a protothread
#define PT_YIELD(pt)
 Yield from the current protothread. More...
 
#define PT_YIELD_UNTIL(pt, cond)
 Yield from the protothread until a condition occurs. More...
 

Detailed Description

Protothreads implementation.

Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se