diff options
Diffstat (limited to 'libcr/coroutine.c')
-rw-r--r-- | libcr/coroutine.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libcr/coroutine.c b/libcr/coroutine.c index 70f2a05..aa23d58 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -764,6 +764,15 @@ cid_t cr_getcid(void) { return coroutine_running; } +void cr_assert_in_coroutine(void) { + assert(!cr_plat_is_in_intrhandler()); + assert_cid_state(coroutine_running, state == CR_RUNNING); +} + +void cr_assert_in_intrhandler(void) { + assert(cr_plat_is_in_intrhandler()); +} + /* cr_cid_info() **************************************************************/ #if CONFIG_COROUTINE_MEASURE_STACK |