summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2013-12-23 04:20:47 +0000
committerdlg <dlg@openbsd.org>2013-12-23 04:20:47 +0000
commit47b16a75264740a5c87e3f10c9f8d89c2a72d3e6 (patch)
treea00003a08155268bf33cd91677cfdf7d9ff2022a /sys
parentImplement a long-standing desideratum, (diff)
downloadwireguard-openbsd-47b16a75264740a5c87e3f10c9f8d89c2a72d3e6.tar.xz
wireguard-openbsd-47b16a75264740a5c87e3f10c9f8d89c2a72d3e6.zip
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_ */