svn commit: r230013 - in stable/8: share/man/man9 sys/sys
John Baldwin
jhb at FreeBSD.org
Thu Jan 12 14:44:15 UTC 2012
Author: jhb
Date: Thu Jan 12 14:44:14 2012
New Revision: 230013
URL: http://svn.freebsd.org/changeset/base/230013
Log:
MFC 228715:
Add a TASK_INITIALIZER() macro that can be used to statically
initialize a task structure.
Modified:
stable/8/share/man/man9/Makefile
stable/8/share/man/man9/taskqueue.9
stable/8/sys/sys/taskqueue.h
Directory Properties:
stable/8/share/man/man9/ (props changed)
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/share/man/man9/Makefile
==============================================================================
--- stable/8/share/man/man9/Makefile Thu Jan 12 14:43:52 2012 (r230012)
+++ stable/8/share/man/man9/Makefile Thu Jan 12 14:44:14 2012 (r230013)
@@ -1218,6 +1218,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent
sysctl_ctx_init.9 sysctl_ctx_entry_find.9 \
sysctl_ctx_init.9 sysctl_ctx_free.9
MLINKS+=taskqueue.9 TASK_INIT.9 \
+ taskqueue.9 TASK_INITIALIZER.9 \
taskqueue.9 taskqueue_create.9 \
taskqueue.9 TASKQUEUE_DECLARE.9 \
taskqueue.9 TASKQUEUE_DEFINE.9 \
Modified: stable/8/share/man/man9/taskqueue.9
==============================================================================
--- stable/8/share/man/man9/taskqueue.9 Thu Jan 12 14:43:52 2012 (r230012)
+++ stable/8/share/man/man9/taskqueue.9 Thu Jan 12 14:44:14 2012 (r230013)
@@ -72,6 +72,7 @@ struct task {
.Ft int
.Fn taskqueue_member "struct taskqueue *queue" "struct thread *td"
.Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context"
+.Fn TASK_INITIALIZER "int priority" "task_fn_t func" "void *context"
.Fn TASKQUEUE_DECLARE "name"
.Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init"
.Fn TASKQUEUE_FAST_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init"
@@ -193,6 +194,9 @@ A convenience macro,
is provided to initialise a
.Va task
structure.
+The
+.Fn TASK_INITIALIZER
+macro generates an initializer for a task structure.
The values of
.Va priority ,
.Va func ,
Modified: stable/8/sys/sys/taskqueue.h
==============================================================================
--- stable/8/sys/sys/taskqueue.h Thu Jan 12 14:43:52 2012 (r230012)
+++ stable/8/sys/sys/taskqueue.h Thu Jan 12 14:44:14 2012 (r230013)
@@ -61,6 +61,12 @@ void taskqueue_block(struct taskqueue *q
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
*/
More information about the svn-src-stable
mailing list