summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2011-12-19 18:55:13 +0000
committerjhb <jhb@FreeBSD.org>2011-12-19 18:55:13 +0000
commit68a134710c655dcf316d05f6071b84d881abde0b (patch)
tree90b7b610edfef8cdb6f35fc64c2e8f294242a7b9 /sys/sys
parent9cdf8d529a192db8c34a2f422acef16340624baa (diff)
downloadFreeBSD-src-68a134710c655dcf316d05f6071b84d881abde0b.zip
FreeBSD-src-68a134710c655dcf316d05f6071b84d881abde0b.tar.gz
Add a TASK_INITIALIZER() macro that can be used to statically
initialize a task structure. Reviewed by: gj MFC after: 2 weeks
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/taskqueue.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h
index dda64cc..b4c7d20 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
*/
OpenPOWER on IntegriCloud