summaryrefslogtreecommitdiff
path: root/libcr/include
diff options
context:
space:
mode:
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