summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uring.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/uring.c b/uring.c
index c8e1dbb..347c7fc 100644
--- a/uring.c
+++ b/uring.c
@@ -142,8 +142,16 @@ uring_parent(struct cfg *cfg)
}
void
-uring_task_init(struct uring_task *task, const char *name, struct uring_task *parent, void (*free)(struct uring_task *))
+uring_task_init(struct uring_task *task, const char *name,
+ struct uring_task *parent, void (*free)(struct uring_task *))
{
+ static bool first = true;
+
+ if (first)
+ first = false;
+ else if (!parent)
+ die("uring_task_init called without a parent\n");
+
if (!free)
die("uring_task_init called without destructor\n");