Go to the documentation of this file.
75 #ifndef LC_ADDRLABELS_H_
76 #define LC_ADDRLABELS_H_
81 #define LC_INIT(s) s = NULL
84 #define LC_RESUME(s) \
92 do { ({ __label__ resume; resume: (s) = &&resume; }); }while(0)
125 #define PT_INIT(pt) LC_INIT((pt)->lc)
145 #define PT_THREAD(name_args) char name_args
160 #define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; if (PT_YIELD_FLAG) {;} LC_RESUME((pt)->lc)
172 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \
173 PT_INIT(pt); return PT_ENDED; }
193 #define PT_WAIT_UNTIL(pt, condition) \
212 #define PT_WAIT_WHILE(pt, cond) PT_WAIT_UNTIL((pt), !(cond))
237 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread))
251 #define PT_SPAWN(pt, child, thread) \
254 PT_WAIT_THREAD((pt), (thread)); \
274 #define PT_RESTART(pt) \
291 #define PT_EXIT(pt) \
316 #define PT_SCHEDULE(f) ((f) < PT_EXITED)
335 #define PT_YIELD(pt) \
339 if(PT_YIELD_FLAG == 0) { \
355 #define PT_YIELD_UNTIL(pt, cond) \
359 if((PT_YIELD_FLAG == 0) || !(cond)) { \
void * lc_t
Definition: pt.h:79
lc_t lc
Definition: pt.h:100