4 Coro
*firstCoro
, *secondCoro
;
6 void secondTask(void *context
)
10 printf("secondTask created with value %d\n", *(int *)context
);
14 printf("secondTask: %d %d\n", (int)Coro_bytesLeftOnStack(secondCoro
), num
++);
15 Coro_switchTo_(secondCoro
, firstCoro
);
19 void firstTask(void *context
)
24 printf("firstTask created with value %d\n", *(int *)context
);
25 secondCoro
= Coro_new();
26 Coro_startCoro_(firstCoro
, secondCoro
, (void *)&value
, secondTask
);
30 printf("firstTask: %d %d\n", (int)Coro_bytesLeftOnStack(firstCoro
), num
++);
31 Coro_switchTo_(firstCoro
, secondCoro
);
37 Coro
*mainCoro
= Coro_new();
40 Coro_initializeMainCoro(mainCoro
);
42 firstCoro
= Coro_new();
43 Coro_startCoro_(mainCoro
, firstCoro
, (void *)&value
, firstTask
);