diff options
| author | Tyge Lovset <[email protected]> | 2023-04-09 11:08:42 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-04-09 11:08:42 +0200 |
| commit | 1e127dd1b9110e025f43a1dfe21d5ae1b248baa4 (patch) | |
| tree | 257040296808968ae173aef3a6d1dad5f0df52a0 /docs | |
| parent | 0a32a32b06170ad588ec837a86df9e3f419c2f4d (diff) | |
| download | STC-modified-1e127dd1b9110e025f43a1dfe21d5ae1b248baa4.tar.gz STC-modified-1e127dd1b9110e025f43a1dfe21d5ae1b248baa4.zip | |
Fixed coroutine docs.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ccommon_api.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index bc0a39ba..a2337161 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -351,14 +351,15 @@ To resume the coroutine from where it was suspended with *cco_yield()*, simply c |:----------|:-------------------------------------|:----------------------------------------| | | `cco_final:` | Obligatory label in coroutine | | | `cco_return;` | Early return from the coroutine | +| `bool` | `cco_alive(ctx)` | Is coroutine in initial or suspended state? | | `bool` | `cco_suspended(ctx)` | Is coroutine in suspended state? | -| `bool` | `cco_alive(ctx)` | Is coroutine still alive? | | `void` | `cco_begin(ctx)` | Begin coroutine block | | `rettype` | `cco_end(retval)` | End coroutine block with return value | -| `rettype` | `cco_end()` | End coroutine block with (void) | -| `rettype` | `cco_yield(retval)` | Return a value and suspend execution | +| `void` | `cco_end()` | End coroutine block | +| `rettype` | `cco_yield(retval)` | Suspend execution and return a value | +| `void` | `cco_yield()` | Suspend execution | | `rettype` | `cco_yield(corocall2, ctx2, retval)` | Yield from another coroutine and return val | -| `rettype` | `cco_yield(corocall2, ctx2)` | Yield from another coroutine (void) | +| `void` | `cco_yield(corocall2, ctx2)` | Yield from another coroutine | | | From the caller side: | | | `void` | `cco_stop(ctx)` | Next call of coroutine returns `cco_end()` | | `void` | `cco_reset(ctx)` | Reset state to initial (for reuse) | |
