Go to the documentation of this file.
80 #define PT_INIT(pt) LC_INIT((pt)->lc)
100 #define PT_THREAD(name_args) char name_args
115 #define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc)
127 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \
128 PT_INIT(pt); return PT_ENDED; }
148 #define PT_WAIT_UNTIL(pt, condition) \
167 #define PT_WAIT_WHILE(pt, cond) PT_WAIT_UNTIL((pt), !(cond))
192 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread))
206 #define PT_SPAWN(pt, child, thread) \
209 PT_WAIT_THREAD((pt), (thread)); \
229 #define PT_RESTART(pt) \
246 #define PT_EXIT(pt) \
271 #define PT_SCHEDULE(f) ((f) < PT_EXITED)
290 #define PT_YIELD(pt) \
294 if(PT_YIELD_FLAG == 0) { \
310 #define PT_YIELD_UNTIL(pt, cond) \
314 if((PT_YIELD_FLAG == 0) || !(cond)) { \