diff options
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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; |