summaryrefslogtreecommitdiffhomepage
path: root/include/stc/algo/coroutine.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-05-02 14:01:38 +0200
committerTyge Løvset <[email protected]>2023-05-02 14:19:20 +0200
commit028b113df1e09cb56ac56b4ad60f633b8fabaded (patch)
tree766a7cdc82fd87d6db5694be1aa3c3a1a00062b9 /include/stc/algo/coroutine.h
parentab7a91c501fb3b7054e836a931754caae578c5f2 (diff)
downloadSTC-modified-028b113df1e09cb56ac56b4ad60f633b8fabaded.tar.gz
STC-modified-028b113df1e09cb56ac56b4ad60f633b8fabaded.zip
Add cco_await_void().
Diffstat (limited to 'include/stc/algo/coroutine.h')
-rw-r--r--include/stc/algo/coroutine.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/stc/algo/coroutine.h b/include/stc/algo/coroutine.h
index f6769162..5cadbc6a 100644
--- a/include/stc/algo/coroutine.h
+++ b/include/stc/algo/coroutine.h
@@ -89,6 +89,7 @@ enum cco_states {
} while (0)
#define cco_await(promise) cco_await_while(!(promise), false)
+#define cco_await_void(promise) cco_await_while(!(promise), )
#define cco_final \
case cco_state_final: \
@@ -120,7 +121,7 @@ typedef struct {
* This macro carries out the "wait" operation on the semaphore. The
* wait operation causes the "thread" to block while the counter is
* zero. When the counter reaches a value larger than zero, the
- * protothread will continue.
+ * "thread" will continue.
*/
#define cco_await_sem(sem) \
do { \
@@ -136,6 +137,6 @@ typedef struct {
* eventually will cause waiting "threads" to continue executing.
*/
#define cco_signal_sem(sem) ++(sem)->count
-#define cco_reset_sem(sem, value) ((sem)->count = value)
+#define cco_reset_sem(sem, value) ((sem)->count = (value))
#endif