summaryrefslogtreecommitdiffhomepage
path: root/docs/ccommon_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-06-13 18:21:04 +0200
committerTyge Løvset <[email protected]>2023-06-13 18:21:04 +0200
commit06f3ae1d904d776aea8a78113c16fc30309817ed (patch)
tree9dd2332386a4cd4a76000d719bf999d41a05998c /docs/ccommon_api.md
parentb564ef6bdfcd2437f1b4997f42054c45ccdedbb1 (diff)
downloadSTC-modified-06f3ae1d904d776aea8a78113c16fc30309817ed.tar.gz
STC-modified-06f3ae1d904d776aea8a78113c16fc30309817ed.zip
Added cco_closue(Ret, Closure) to define coroutine closure.
Added back cco_await_on(child) calls.
Diffstat (limited to 'docs/ccommon_api.md')
-rw-r--r--docs/ccommon_api.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md
index 1f0847da..89a98cbb 100644
--- a/docs/ccommon_api.md
+++ b/docs/ccommon_api.md
@@ -380,6 +380,9 @@ To resume the coroutine from where it was suspended with *cco_yield()*, simply c
| | `cco_await(promise, ret)` | Await/suspend with ret value |
| | `cco_return` | Replaces return. Jump to cco_final: if exist|
| | `cco_return_v(val)` | Yield final value, enter final-state |
+| | `cco_closure(Ret, Closure, ...)` | Define coroutine closure struct. |
+| `void` | `cco_await_on(closure) { }` | Await on closure to finish |
+| `void` | `cco_await_on(co, func) { }` | Await on func(co) to finish |
| | Semaphores: | |
| | `cco_sem` | Semaphore type |
| | `cco_sem_await(sem)` | Await for the semaphore count > 0 |
@@ -398,7 +401,8 @@ To resume the coroutine from where it was suspended with *cco_yield()*, simply c
| | From caller side: | |
| `void` | `cco_stop(co)` | Next call of coroutine finalizes |
| `void` | `cco_reset(co)` | Reset state to initial (for reuse) |
-| `void` | `cco_run(co, corocall) { }` | Run blocking until coro is done |
+| `void` | `cco_block_on(closure) { }` | Run blocking until closure is finished |
+| `void` | `cco_block_on(co, func) { }` | Run blocking until func is finished |
| | Time functions: | |
| `double` | `cco_time(void)` | Return secs with usec prec. since Epoch |
| | `cco_sleep(double sec)` | Sleep for seconds (msec or usec prec.) |