summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/coroutines/cotasks1.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-08-01 16:47:38 +0200
committerTyge Løvset <[email protected]>2023-08-01 16:47:38 +0200
commit2ae41a5b709abdb549c4128b43e25ee8a704fcc4 (patch)
tree8494d338510f033b95c3ed0c5f3abebaa080dfd5 /misc/examples/coroutines/cotasks1.c
parent6354a597892e84baa6c3a99b98f2c7acaf33a99d (diff)
downloadSTC-modified-2ae41a5b709abdb549c4128b43e25ee8a704fcc4.tar.gz
STC-modified-2ae41a5b709abdb549c4128b43e25ee8a704fcc4.zip
Last minute API change for coroutines before V4.3 release:
- Renamed cco_xxxx_await() => cco_await_xxxx() (call, task, sem, timer) - Renamed cco_xxxx_blocking() => cco_blocking_xxxx() (call, task) - Renamed cco_task_resume() => cco_resume_task()
Diffstat (limited to 'misc/examples/coroutines/cotasks1.c')
-rw-r--r--misc/examples/coroutines/cotasks1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc/examples/coroutines/cotasks1.c b/misc/examples/coroutines/cotasks1.c
index e4afbe2b..230bd62b 100644
--- a/misc/examples/coroutines/cotasks1.c
+++ b/misc/examples/coroutines/cotasks1.c
@@ -16,7 +16,7 @@ int next_value(struct next_value* co)
{
cco_routine (co) {
while (true) {
- cco_timer_await(&co->tm, 1 + rand() % 2);
+ cco_await_timer(&co->tm, 1 + rand() % 2);
co->val = rand();
cco_yield();
}
@@ -88,7 +88,7 @@ int main(void)
struct consume_items consume = {.n=5};
int count = 0;
- cco_call_blocking(consume_items(&consume, &produce))
+ cco_blocking_call(consume_items(&consume, &produce))
{
++count;
//cco_sleep(0.001);