summaryrefslogtreecommitdiffhomepage
path: root/docs/ccommon_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-05-04 11:51:56 +0200
committerTyge Løvset <[email protected]>2023-05-04 16:19:00 +0200
commitb03148caa1d6fc660e6e7c5986dd6fd38779bedc (patch)
tree6e4c7972437f6e8e6fddf39b0f48a2b0ace05af8 /docs/ccommon_api.md
parent6b23e35287f26dad63abd755c5f365b443e025a3 (diff)
downloadSTC-modified-b03148caa1d6fc660e6e7c5986dd6fd38779bedc.tar.gz
STC-modified-b03148caa1d6fc660e6e7c5986dd6fd38779bedc.zip
Updates in coroutines.h: No longer *required* with cco_final:, but only when no cleanup is needed.
Diffstat (limited to 'docs/ccommon_api.md')
-rw-r--r--docs/ccommon_api.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md
index 7014def8..2319109b 100644
--- a/docs/ccommon_api.md
+++ b/docs/ccommon_api.md
@@ -314,7 +314,7 @@ bool triples(struct triples* i) { // coroutine
}
}
}
- cco_final: // required label
+ cco_final: // required for cleanup
puts("done");
cco_end(true);
}
@@ -352,15 +352,15 @@ To resume the coroutine from where it was suspended with *cco_yield()*, simply c
| | Function / operator | Description |
|:----------|:-------------------------------------|:----------------------------------------|
-| | `cco_final:` | Obligatory label in coroutine |
+| | `cco_final:` | Label for cleanup in coroutine |
| | `cco_return` | Early return from the coroutine (no arg) |
| `bool` | `cco_suspended(ctx)` | Is coroutine in suspended state? |
| `bool` | `cco_done(ctx)` | Is coroutine done? |
| | `cco_begin(ctx)` | Begin coroutine block |
-| | `cco_end(retval)` | End coroutine block and return retval |
| | `cco_end()` | End coroutine block |
-| | `cco_yield(retval)` | Suspend execution and return retval |
+| | `cco_end(retval)` | End coroutine block and return retval |
| | `cco_yield()` | Suspend execution |
+| | `cco_yield(retval)` | Suspend execution and return retval |
| | `cco_await(promise)` | Suspend until promise is true |
| | `cco_await_with(promise, retval)` | Suspend with retval until promise is true |
| | Semaphores: | |