summaryrefslogtreecommitdiff
path: root/coroutine.h
diff options
context:
space:
mode:
Diffstat (limited to 'coroutine.h')
-rw-r--r--coroutine.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/coroutine.h b/coroutine.h
index 77cb0a3..d22eb2e 100644
--- a/coroutine.h
+++ b/coroutine.h
@@ -32,7 +32,7 @@ void coroutine_task(void);
/* core macros for use in a cr_fn_t() *****************************************/
#define cr_begin() switch(_coroutine_table[_cur_cid].state) { case 0:
#define cr_exit() do { _coroutine_table[_cur_cid] = (cr_entry_t){0}; return; } while (0)
-#define cr_yield() _cr_yield(__COUNTER__)
+#define cr_yield() _cr_yield(__COUNTER__+1)
#define _cr_yield(_state) do { _coroutine_table[_cur_cid].state = _state; return; case _state:; } while (0)
#define cr_end() }