diff options
author | John Baldwin <jhb@FreeBSD.org> | 2011-12-19 18:55:13 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2011-12-19 18:55:13 +0000 |
commit | a7f5f7948b9d500472d72698a7765cde7edfa3f0 (patch) | |
tree | 90b7b610edfef8cdb6f35fc64c2e8f294242a7b9 /sys | |
parent | ad5b59d82cebcffa6655265316f5808b98a7151f (diff) | |
download | src-a7f5f7948b9d500472d72698a7765cde7edfa3f0.tar.gz src-a7f5f7948b9d500472d72698a7765cde7edfa3f0.zip |
Add a TASK_INITIALIZER() macro that can be used to statically
initialize a task structure.
Reviewed by: gj
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=228715
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/taskqueue.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h index dda64ccb04a2..b4c7d2081393 100644 --- a/sys/sys/taskqueue.h +++ b/sys/sys/taskqueue.h @@ -77,6 +77,12 @@ void taskqueue_block(struct taskqueue *queue); void taskqueue_unblock(struct taskqueue *queue); int taskqueue_member(struct taskqueue *queue, struct thread *td); +#define TASK_INITIALIZER(priority, func, context) \ + { .ta_pending = 0, \ + .ta_priority = (priority), \ + .ta_func = (func), \ + .ta_context = (context) } + /* * Functions for dedicated thread taskqueues */ |