summaryrefslogtreecommitdiff
path: root/libcr/include
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-09 12:24:52 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-09 12:24:52 -0700
commit87646c7959726bc0556d28f78fb730edd8365410 (patch)
tree087f074391f4beccc08626f966d945d0cad60aba /libcr/include
parent96a751d8a5d20b2acea5ae8d10ac3d051466c2c3 (diff)
parentb1414723ab4171a7ca5fc5e8a5ac7c4eb43331e2 (diff)
Merge commit 'b1414723ab4171a7ca5fc5e8a5ac7c4eb43331e2'
Diffstat (limited to 'libcr/include')
-rw-r--r--libcr/include/libcr/coroutine.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libcr/include/libcr/coroutine.h b/libcr/include/libcr/coroutine.h
index f6c5e14..eb5828b 100644
--- a/libcr/include/libcr/coroutine.h
+++ b/libcr/include/libcr/coroutine.h
@@ -164,6 +164,27 @@ bool cr_is_in_intrhandler(void);
*/
void cr_unpause_from_intrhandler(cid_t);
+/**
+ * cr_assert_in_coroutine() asserts that it is being called from a
+ * running coroutine.
+ */
+#ifdef NDEBUG
+#define cr_assert_in_coroutine() ((void)0)
+#else
+void cr_assert_in_coroutine(void);
+#endif
+
+
+/**
+ * cr_assert_in_intrhandler() asserts that it is being called from an
+ * interrupt handler.
+ */
+#ifdef NDEBUG
+#define cr_assert_in_intrhandler() ((void)0)
+#else
+void cr_assert_in_intrhandler(void);
+#endif
+
/* answering questions about coroutines ***************************************/
/* While the following are defined here unconditionally, the