summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-12-23 04:20:48 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-12-23 04:20:48 +0000
commitb83679fc7dfce3ba6beb284acadd1865997a059a (patch)
treed44a8d270fa3881fa30a872b0e00961ed9817591 /sys
parentecd1d85f01c96067c5b9631832e7634f3cfe65f3 (diff)
provide a TASK_INITIALIZER() macro.
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/task.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/sys/task.h b/sys/sys/task.h
index 7319ec37fee..1691aef3650 100644
--- a/sys/sys/task.h
+++ b/sys/sys/task.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: task.h,v 1.4 2013/10/31 04:33:32 deraadt Exp $ */
+/* $OpenBSD: task.h,v 1.5 2013/12/23 04:20:47 dlg Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
@@ -41,6 +41,10 @@ void task_set(struct task *, void (*)(void *, void *),
void *, void *);
int task_add(struct taskq *, struct task *);
int task_del(struct taskq *, struct task *);
+
+#define TASK_INITIALIZER(_f, _a1, _a2) \
+ { { NULL, NULL }, (_f), (_a1), (_a2), 0 }
+
#endif /* _KERNEL */
#endif /* _SYS_TASKQ_H_ */