From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 14:43:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1A7106564A; Thu, 12 Jan 2012 14:43:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573F28FC15; Thu, 12 Jan 2012 14:43:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0CEhrlQ013796; Thu, 12 Jan 2012 14:43:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CEhrUi013792; Thu, 12 Jan 2012 14:43:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201121443.q0CEhrUi013792@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jan 2012 14:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230012 - in stable/9: share/man/man9 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 14:43:53 -0000 Author: jhb Date: Thu Jan 12 14:43:52 2012 New Revision: 230012 URL: http://svn.freebsd.org/changeset/base/230012 Log: MFC 228715: Add a TASK_INITIALIZER() macro that can be used to statically initialize a task structure. Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/taskqueue.9 stable/9/sys/sys/taskqueue.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Thu Jan 12 14:40:25 2012 (r230011) +++ stable/9/share/man/man9/Makefile Thu Jan 12 14:43:52 2012 (r230012) @@ -1254,6 +1254,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent sysctl_ctx_init.9 sysctl_ctx_free.9 MLINKS+=SYSINIT.9 SYSUNINIT.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ + taskqueue.9 TASK_INITIALIZER.9 \ taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ Modified: stable/9/share/man/man9/taskqueue.9 ============================================================================== --- stable/9/share/man/man9/taskqueue.9 Thu Jan 12 14:40:25 2012 (r230011) +++ stable/9/share/man/man9/taskqueue.9 Thu Jan 12 14:43:52 2012 (r230012) @@ -80,6 +80,7 @@ struct timeout_task; .Ft void .Fn taskqueue_run "struct taskqueue *queue" .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" @@ -243,9 +244,14 @@ A convenience macro, is provided to initialise a .Va task structure. +The +.Fn TASK_INITIALIZER +macro generates an initializer for a task structure. A macro .Fn TIMEOUT_TASK_INIT "queue" "timeout_task" "priority" "func" "context" -initializes the timeout_task structure. +initializes the +.Va timeout_task +structure. The values of .Va priority , .Va func , Modified: stable/9/sys/sys/taskqueue.h ============================================================================== --- stable/9/sys/sys/taskqueue.h Thu Jan 12 14:40:25 2012 (r230011) +++ stable/9/sys/sys/taskqueue.h Thu Jan 12 14:43:52 2012 (r230012) @@ -77,6 +77,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 */