summaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'main.h')
-rw-r--r--main.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.h b/main.h
index 39c2440..7d14118 100644
--- a/main.h
+++ b/main.h
@@ -96,6 +96,21 @@ struct uring_task {
void *priv;
};
+#define assert_task_alive_or(lvl, t, cmd) \
+do { \
+ if (!(t)) { \
+ error("invalid task\n"); \
+ cmd; \
+ } \
+ \
+ if ((t)->dead) { \
+ debug((lvl), "task dead\n"); \
+ cmd; \
+ } \
+} while(0)
+
+#define assert_task_alive(lvl, t) assert_task_alive_or((lvl), (t), return)
+
struct cfg {
uid_t uid;
gid_t gid;