summaryrefslogtreecommitdiffstats
path: root/sys/sys/task.h
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-01-27 03:17:35 +0000
committerdlg <dlg@openbsd.org>2015-01-27 03:17:35 +0000
commite419548092f59c20a140404818050eb2ab331a19 (patch)
treeff250435e8b28c07c967073741c21d374241b774 /sys/sys/task.h
parentRemove an unused and confusing assignment that had been commented out for (diff)
downloadwireguard-openbsd-e419548092f59c20a140404818050eb2ab331a19.tar.xz
wireguard-openbsd-e419548092f59c20a140404818050eb2ab331a19.zip
remove the second void * argument on tasks.
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
Diffstat (limited to 'sys/sys/task.h')
-rw-r--r--sys/sys/task.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/sys/task.h b/sys/sys/task.h
index fc19aa5f83d..9eef0adc019 100644
--- a/sys/sys/task.h
+++ b/sys/sys/task.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: task.h,v 1.6 2014/06/11 08:47:53 blambert Exp $ */
+/* $OpenBSD: task.h,v 1.7 2015/01/27 03:17:37 dlg Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
@@ -25,9 +25,8 @@ struct taskq;
struct task {
TAILQ_ENTRY(task) t_entry;
- void (*t_func)(void *, void *);
- void *t_arg1;
- void *t_arg2;
+ void (*t_func)(void *);
+ void *t_arg;
unsigned int t_flags;
};
@@ -38,13 +37,12 @@ extern struct taskq *const systqmp;
struct taskq *taskq_create(const char *, unsigned int, int);
void taskq_destroy(struct taskq *);
-void task_set(struct task *, void (*)(void *, void *),
- void *, void *);
+void task_set(struct task *, 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 }
+#define TASK_INITIALIZER(_f, _a) \
+ { { NULL, NULL }, (_f), (_a), 0 }
#endif /* _KERNEL */