summaryrefslogtreecommitdiffhomepage
path: root/misc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-05-08 18:45:24 +0200
committerTyge Løvset <[email protected]>2023-05-08 18:45:24 +0200
commit2f11c7cf36690a1493344189b6a011c26ee58a9b (patch)
tree5ca6eba321563ec661277b5247271ebc828e9b59 /misc
parentf8f544d8f5b805b9749f1e06fd7c1875b6115d48 (diff)
downloadSTC-modified-2f11c7cf36690a1493344189b6a011c26ee58a9b.tar.gz
STC-modified-2f11c7cf36690a1493344189b6a011c26ee58a9b.zip
coroutine cco_await_* and cco_yield_* changes.
Diffstat (limited to 'misc')
-rw-r--r--misc/examples/cointerleave.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/cointerleave.c b/misc/examples/cointerleave.c
index 0ccf9ad7..0854a741 100644
--- a/misc/examples/cointerleave.c
+++ b/misc/examples/cointerleave.c
@@ -28,10 +28,10 @@ struct Generator {
void interleaved(struct Generator* g)
{
cco_begin(g);
- while (!cco_done(&g->x) || !cco_done(&g->y))
+ while (!(cco_done(&g->x) & cco_done(&g->y)))
{
- cco_yield_sub(&g->x, g->value = get_value(&g->x));
- cco_yield_sub(&g->y, g->value = get_value(&g->y));
+ cco_yield_at(&g->x, g->value = get_value(&g->x));
+ cco_yield_at(&g->y, g->value = get_value(&g->y));
}
cco_end();
}