#include #include #include #include #include "ot.h" /****************************************************************************/ /* the most basic example */ unsigned example_th(struct ot_state *ots, int count) { OT_BEGIN(ots); printf("enter %s\n", __func__); OT_WAIT_WHILE(ots, count < 5); /* printf(stderr, "debug: at line %d\n", OT_LINE(ots)); */ printf("complete %s\n", __func__); OT_END(ots); } /****************************************************************************/ int main(int argc, char **argv) { struct ot_state ex = OT_INITIALIZER; /* the most basic example */ int count = 1; while(example_th(&ex, count)) { printf("Looping...\n"); count++; } return 0; }