diff options
| author | Tyge Løvset <[email protected]> | 2023-08-01 16:47:38 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-08-01 18:09:40 +0200 |
| commit | 94391527ef50cbee073a4b427f6fe839c010ecb1 (patch) | |
| tree | f4d48b7efd6a11d94d08c4ef2ee599601b949dbb /misc/examples/coroutines/cotasks1.c | |
| parent | 6354a597892e84baa6c3a99b98f2c7acaf33a99d (diff) | |
| download | STC-modified-94391527ef50cbee073a4b427f6fe839c010ecb1.tar.gz STC-modified-94391527ef50cbee073a4b427f6fe839c010ecb1.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()
- Simplified cco_blocking_call()
Diffstat (limited to 'misc/examples/coroutines/cotasks1.c')
| -rw-r--r-- | misc/examples/coroutines/cotasks1.c | 4 |
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); |
