summaryrefslogtreecommitdiff
path: root/libcr/coroutine.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-15 20:42:00 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-19 20:15:48 -0700
commit51e4ec63b745836c33b6f92c9cbfafb8892e1843 (patch)
treef54fc1ccdf67c61bd5959e5ab625c3846d8a590f /libcr/coroutine.c
parent7aa534178293279b861a6dc36499c179aa70cdfb (diff)
libcr: Assert that cr_getcid() is only called inside a coroutine
Diffstat (limited to 'libcr/coroutine.c')
-rw-r--r--libcr/coroutine.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libcr/coroutine.c b/libcr/coroutine.c
index 7f61e94..9f1150b 100644
--- a/libcr/coroutine.c
+++ b/libcr/coroutine.c
@@ -606,6 +606,7 @@ void cr_unpause_from_intrhandler(cid_t cid) {
}
cid_t cr_getcid(void) {
+ assert_cid_state(coroutine_running, state == CR_RUNNING);
return coroutine_running;
}