2000-05-28 11:45:30 -04:00
|
|
|
/*-
|
2017-11-27 10:01:59 -05:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
|
|
|
|
*
|
2000-05-28 11:45:30 -04:00
|
|
|
* Copyright (c) 2000 Doug Rabson
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
|
* are met:
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
|
*
|
2000-05-30 03:27:46 -04:00
|
|
|
* $FreeBSD$
|
2000-05-28 11:45:30 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _SYS_TASKQUEUE_H_
|
|
|
|
|
#define _SYS_TASKQUEUE_H_
|
|
|
|
|
|
2000-05-30 03:27:46 -04:00
|
|
|
#ifndef _KERNEL
|
2017-01-15 13:00:45 -05:00
|
|
|
#error "no user-serviceable parts inside"
|
2000-05-30 03:27:46 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <sys/queue.h>
|
2004-01-23 15:44:26 -05:00
|
|
|
#include <sys/_task.h>
|
2011-04-26 07:39:56 -04:00
|
|
|
#include <sys/_callout.h>
|
2015-02-16 21:35:06 -05:00
|
|
|
#include <sys/_cpuset.h>
|
2000-05-28 11:45:30 -04:00
|
|
|
|
|
|
|
|
struct taskqueue;
|
2016-05-18 00:35:58 -04:00
|
|
|
struct taskqgroup;
|
2019-10-17 02:32:34 -04:00
|
|
|
struct proc;
|
2009-08-17 05:01:20 -04:00
|
|
|
struct thread;
|
2000-05-28 11:45:30 -04:00
|
|
|
|
2011-04-26 07:39:56 -04:00
|
|
|
struct timeout_task {
|
|
|
|
|
struct taskqueue *q;
|
|
|
|
|
struct task t;
|
|
|
|
|
struct callout c;
|
|
|
|
|
int f;
|
|
|
|
|
};
|
|
|
|
|
|
Extend taskqueue(9) to enable per-taskqueue callbacks.
The scope of these callbacks is primarily to support actions that affect the
taskqueue's thread environments. They are entirely optional, and
consequently are introduced as a new API: taskqueue_set_callback().
This interface allows the caller to specify that a taskqueue requires a
callback and optional context pointer for a given callback type.
The callback types included in this commit can be used to register a
constructor and destructor for thread-local storage using osd(9). This
allows a particular taskqueue to define that its threads require a specific
type of TLS, without the need for a specially-orchestrated task-based
mechanism for startup and shutdown in order to accomplish it.
Two callback types are supported at this point:
- TASKQUEUE_CALLBACK_TYPE_INIT, called by every thread when it starts, prior
to processing any tasks.
- TASKQUEUE_CALLBACK_TYPE_SHUTDOWN, called by every thread when it exits,
after it has processed its last task but before the taskqueue is
reclaimed.
While I'm here:
- Add two new macros, TQ_ASSERT_LOCKED and TQ_ASSERT_UNLOCKED, and use them
in appropriate locations.
- Fix taskqueue.9 to mention taskqueue_start_threads(), which is a required
interface for all consumers of taskqueue(9).
Reviewed by: kib (all), eadler (taskqueue.9), brd (taskqueue.9)
Approved by: ken (mentor)
Sponsored by: Spectra Logic
MFC after: 1 month
2013-03-23 11:11:53 -04:00
|
|
|
enum taskqueue_callback_type {
|
|
|
|
|
TASKQUEUE_CALLBACK_TYPE_INIT,
|
|
|
|
|
TASKQUEUE_CALLBACK_TYPE_SHUTDOWN,
|
|
|
|
|
};
|
|
|
|
|
#define TASKQUEUE_CALLBACK_TYPE_MIN TASKQUEUE_CALLBACK_TYPE_INIT
|
|
|
|
|
#define TASKQUEUE_CALLBACK_TYPE_MAX TASKQUEUE_CALLBACK_TYPE_SHUTDOWN
|
|
|
|
|
#define TASKQUEUE_NUM_CALLBACKS TASKQUEUE_CALLBACK_TYPE_MAX + 1
|
2016-05-19 13:14:24 -04:00
|
|
|
#define TASKQUEUE_NAMELEN 32
|
Extend taskqueue(9) to enable per-taskqueue callbacks.
The scope of these callbacks is primarily to support actions that affect the
taskqueue's thread environments. They are entirely optional, and
consequently are introduced as a new API: taskqueue_set_callback().
This interface allows the caller to specify that a taskqueue requires a
callback and optional context pointer for a given callback type.
The callback types included in this commit can be used to register a
constructor and destructor for thread-local storage using osd(9). This
allows a particular taskqueue to define that its threads require a specific
type of TLS, without the need for a specially-orchestrated task-based
mechanism for startup and shutdown in order to accomplish it.
Two callback types are supported at this point:
- TASKQUEUE_CALLBACK_TYPE_INIT, called by every thread when it starts, prior
to processing any tasks.
- TASKQUEUE_CALLBACK_TYPE_SHUTDOWN, called by every thread when it exits,
after it has processed its last task but before the taskqueue is
reclaimed.
While I'm here:
- Add two new macros, TQ_ASSERT_LOCKED and TQ_ASSERT_UNLOCKED, and use them
in appropriate locations.
- Fix taskqueue.9 to mention taskqueue_start_threads(), which is a required
interface for all consumers of taskqueue(9).
Reviewed by: kib (all), eadler (taskqueue.9), brd (taskqueue.9)
Approved by: ken (mentor)
Sponsored by: Spectra Logic
MFC after: 1 month
2013-03-23 11:11:53 -04:00
|
|
|
|
|
|
|
|
typedef void (*taskqueue_callback_fn)(void *context);
|
|
|
|
|
|
2000-05-28 11:45:30 -04:00
|
|
|
/*
|
|
|
|
|
* A notification callback function which is called from
|
2000-05-30 03:27:46 -04:00
|
|
|
* taskqueue_enqueue(). The context argument is given in the call to
|
|
|
|
|
* taskqueue_create(). This function would normally be used to allow the
|
|
|
|
|
* queue to arrange to run itself later (e.g., by scheduling a software
|
2000-05-28 11:45:30 -04:00
|
|
|
* interrupt or waking a kernel thread).
|
|
|
|
|
*/
|
|
|
|
|
typedef void (*taskqueue_enqueue_fn)(void *context);
|
|
|
|
|
|
2000-05-30 03:27:46 -04:00
|
|
|
struct taskqueue *taskqueue_create(const char *name, int mflags,
|
|
|
|
|
taskqueue_enqueue_fn enqueue,
|
2006-01-13 20:55:24 -05:00
|
|
|
void *context);
|
|
|
|
|
int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri,
|
2019-10-17 02:32:34 -04:00
|
|
|
const char *name, ...) __printflike(4, 5);
|
|
|
|
|
int taskqueue_start_threads_in_proc(struct taskqueue **tqp, int count,
|
|
|
|
|
int pri, struct proc *p, const char *name, ...) __printflike(5, 6);
|
2015-02-16 21:35:06 -05:00
|
|
|
int taskqueue_start_threads_cpuset(struct taskqueue **tqp, int count,
|
|
|
|
|
int pri, cpuset_t *mask, const char *name, ...) __printflike(5, 6);
|
2000-05-30 03:27:46 -04:00
|
|
|
int taskqueue_enqueue(struct taskqueue *queue, struct task *task);
|
2011-04-26 07:39:56 -04:00
|
|
|
int taskqueue_enqueue_timeout(struct taskqueue *queue,
|
|
|
|
|
struct timeout_task *timeout_task, int ticks);
|
2017-07-30 20:54:50 -04:00
|
|
|
int taskqueue_enqueue_timeout_sbt(struct taskqueue *queue,
|
|
|
|
|
struct timeout_task *timeout_task, sbintime_t sbt, sbintime_t pr,
|
|
|
|
|
int flags);
|
2017-03-02 07:20:23 -05:00
|
|
|
int taskqueue_poll_is_busy(struct taskqueue *queue, struct task *task);
|
2010-11-08 15:56:31 -05:00
|
|
|
int taskqueue_cancel(struct taskqueue *queue, struct task *task,
|
|
|
|
|
u_int *pendp);
|
2011-04-26 07:39:56 -04:00
|
|
|
int taskqueue_cancel_timeout(struct taskqueue *queue,
|
|
|
|
|
struct timeout_task *timeout_task, u_int *pendp);
|
2004-10-05 00:16:01 -04:00
|
|
|
void taskqueue_drain(struct taskqueue *queue, struct task *task);
|
2011-04-26 07:39:56 -04:00
|
|
|
void taskqueue_drain_timeout(struct taskqueue *queue,
|
|
|
|
|
struct timeout_task *timeout_task);
|
2013-11-28 13:56:34 -05:00
|
|
|
void taskqueue_drain_all(struct taskqueue *queue);
|
2018-11-21 12:18:27 -05:00
|
|
|
void taskqueue_quiesce(struct taskqueue *queue);
|
2000-05-30 03:27:46 -04:00
|
|
|
void taskqueue_free(struct taskqueue *queue);
|
2010-10-13 18:59:04 -04:00
|
|
|
void taskqueue_run(struct taskqueue *queue);
|
2008-03-25 18:38:45 -04:00
|
|
|
void taskqueue_block(struct taskqueue *queue);
|
|
|
|
|
void taskqueue_unblock(struct taskqueue *queue);
|
2009-08-17 05:01:20 -04:00
|
|
|
int taskqueue_member(struct taskqueue *queue, struct thread *td);
|
Extend taskqueue(9) to enable per-taskqueue callbacks.
The scope of these callbacks is primarily to support actions that affect the
taskqueue's thread environments. They are entirely optional, and
consequently are introduced as a new API: taskqueue_set_callback().
This interface allows the caller to specify that a taskqueue requires a
callback and optional context pointer for a given callback type.
The callback types included in this commit can be used to register a
constructor and destructor for thread-local storage using osd(9). This
allows a particular taskqueue to define that its threads require a specific
type of TLS, without the need for a specially-orchestrated task-based
mechanism for startup and shutdown in order to accomplish it.
Two callback types are supported at this point:
- TASKQUEUE_CALLBACK_TYPE_INIT, called by every thread when it starts, prior
to processing any tasks.
- TASKQUEUE_CALLBACK_TYPE_SHUTDOWN, called by every thread when it exits,
after it has processed its last task but before the taskqueue is
reclaimed.
While I'm here:
- Add two new macros, TQ_ASSERT_LOCKED and TQ_ASSERT_UNLOCKED, and use them
in appropriate locations.
- Fix taskqueue.9 to mention taskqueue_start_threads(), which is a required
interface for all consumers of taskqueue(9).
Reviewed by: kib (all), eadler (taskqueue.9), brd (taskqueue.9)
Approved by: ken (mentor)
Sponsored by: Spectra Logic
MFC after: 1 month
2013-03-23 11:11:53 -04:00
|
|
|
void taskqueue_set_callback(struct taskqueue *queue,
|
|
|
|
|
enum taskqueue_callback_type cb_type,
|
|
|
|
|
taskqueue_callback_fn callback, void *context);
|
2000-05-28 11:45:30 -04:00
|
|
|
|
2011-12-19 13:55:13 -05:00
|
|
|
#define TASK_INITIALIZER(priority, func, context) \
|
2020-02-11 13:48:07 -05:00
|
|
|
{ .ta_priority = (priority), \
|
2011-12-19 13:55:13 -05:00
|
|
|
.ta_func = (func), \
|
|
|
|
|
.ta_context = (context) }
|
|
|
|
|
|
2004-08-07 22:37:22 -04:00
|
|
|
/*
|
|
|
|
|
* Functions for dedicated thread taskqueues
|
|
|
|
|
*/
|
|
|
|
|
void taskqueue_thread_loop(void *arg);
|
|
|
|
|
void taskqueue_thread_enqueue(void *context);
|
|
|
|
|
|
2000-05-28 11:45:30 -04:00
|
|
|
/*
|
|
|
|
|
* Initialise a task structure.
|
|
|
|
|
*/
|
2020-02-11 13:48:07 -05:00
|
|
|
#define TASK_INIT_FLAGS(task, priority, func, context, flags) do { \
|
|
|
|
|
(task)->ta_pending = 0; \
|
|
|
|
|
(task)->ta_priority = (priority); \
|
|
|
|
|
(task)->ta_flags = (flags); \
|
|
|
|
|
(task)->ta_func = (func); \
|
|
|
|
|
(task)->ta_context = (context); \
|
2001-10-26 14:46:48 -04:00
|
|
|
} while (0)
|
2000-05-28 11:45:30 -04:00
|
|
|
|
2020-02-11 13:48:07 -05:00
|
|
|
#define TASK_INIT(t, p, f, c) TASK_INIT_FLAGS(t, p, f, c, 0)
|
|
|
|
|
|
2011-04-26 07:39:56 -04:00
|
|
|
void _timeout_task_init(struct taskqueue *queue,
|
|
|
|
|
struct timeout_task *timeout_task, int priority, task_fn_t func,
|
|
|
|
|
void *context);
|
2020-02-11 13:48:07 -05:00
|
|
|
#define TIMEOUT_TASK_INIT(queue, timeout_task, priority, func, context) do { \
|
|
|
|
|
_Static_assert((priority) >= 0 && (priority) <= 255, \
|
|
|
|
|
"struct task priority is 8 bit in size"); \
|
|
|
|
|
_timeout_task_init(queue, timeout_task, priority, func, context); \
|
|
|
|
|
} while (0)
|
2011-04-26 07:39:56 -04:00
|
|
|
|
2000-05-28 11:45:30 -04:00
|
|
|
/*
|
|
|
|
|
* Declare a reference to a taskqueue.
|
|
|
|
|
*/
|
|
|
|
|
#define TASKQUEUE_DECLARE(name) \
|
|
|
|
|
extern struct taskqueue *taskqueue_##name
|
|
|
|
|
|
|
|
|
|
/*
|
2006-01-10 01:31:12 -05:00
|
|
|
* Define and initialise a global taskqueue that uses sleep mutexes.
|
2000-05-28 11:45:30 -04:00
|
|
|
*/
|
2000-05-30 03:27:46 -04:00
|
|
|
#define TASKQUEUE_DEFINE(name, enqueue, context, init) \
|
2000-05-28 11:45:30 -04:00
|
|
|
\
|
|
|
|
|
struct taskqueue *taskqueue_##name; \
|
|
|
|
|
\
|
|
|
|
|
static void \
|
|
|
|
|
taskqueue_define_##name(void *arg) \
|
|
|
|
|
{ \
|
|
|
|
|
taskqueue_##name = \
|
2011-02-04 09:06:57 -05:00
|
|
|
taskqueue_create(#name, M_WAITOK, (enqueue), (context)); \
|
2000-05-28 11:45:30 -04:00
|
|
|
init; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
2017-08-16 17:42:27 -04:00
|
|
|
SYSINIT(taskqueue_##name, SI_SUB_TASKQ, SI_ORDER_SECOND, \
|
2008-03-16 06:58:09 -04:00
|
|
|
taskqueue_define_##name, NULL); \
|
2000-05-30 03:27:46 -04:00
|
|
|
\
|
|
|
|
|
struct __hack
|
2004-08-07 22:37:22 -04:00
|
|
|
#define TASKQUEUE_DEFINE_THREAD(name) \
|
|
|
|
|
TASKQUEUE_DEFINE(name, taskqueue_thread_enqueue, &taskqueue_##name, \
|
2006-01-13 20:55:24 -05:00
|
|
|
taskqueue_start_threads(&taskqueue_##name, 1, PWAIT, \
|
|
|
|
|
"%s taskq", #name))
|
2000-05-28 11:45:30 -04:00
|
|
|
|
2006-01-10 01:31:12 -05:00
|
|
|
/*
|
|
|
|
|
* Define and initialise a global taskqueue that uses spin mutexes.
|
|
|
|
|
*/
|
|
|
|
|
#define TASKQUEUE_FAST_DEFINE(name, enqueue, context, init) \
|
|
|
|
|
\
|
|
|
|
|
struct taskqueue *taskqueue_##name; \
|
|
|
|
|
\
|
|
|
|
|
static void \
|
|
|
|
|
taskqueue_define_##name(void *arg) \
|
|
|
|
|
{ \
|
|
|
|
|
taskqueue_##name = \
|
2011-02-04 09:06:57 -05:00
|
|
|
taskqueue_create_fast(#name, M_WAITOK, (enqueue), \
|
2006-01-13 20:55:24 -05:00
|
|
|
(context)); \
|
2006-01-10 01:31:12 -05:00
|
|
|
init; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
2017-08-16 17:42:27 -04:00
|
|
|
SYSINIT(taskqueue_##name, SI_SUB_TASKQ, SI_ORDER_SECOND, \
|
2008-03-16 06:58:09 -04:00
|
|
|
taskqueue_define_##name, NULL); \
|
2006-01-10 01:31:12 -05:00
|
|
|
\
|
|
|
|
|
struct __hack
|
|
|
|
|
#define TASKQUEUE_FAST_DEFINE_THREAD(name) \
|
|
|
|
|
TASKQUEUE_FAST_DEFINE(name, taskqueue_thread_enqueue, \
|
2021-05-24 23:37:55 -04:00
|
|
|
&taskqueue_##name, taskqueue_start_threads(&taskqueue_##name, \
|
2006-01-13 20:55:24 -05:00
|
|
|
1, PWAIT, "%s taskq", #name))
|
2006-01-10 01:31:12 -05:00
|
|
|
|
2000-05-28 11:45:30 -04:00
|
|
|
/*
|
Move dynamic sysctl(8) variable creation for the cd(4) and da(4) drivers
out of cdregister() and daregister(), which are run from interrupt context.
The sysctl code does blocking mallocs (M_WAITOK), which causes problems
if malloc(9) actually needs to sleep.
The eventual fix for this issue will involve moving the CAM probe process
inside a kernel thread. For now, though, I have fixed the issue by moving
dynamic sysctl variable creation for these two drivers to a task queue
running in a kernel thread.
The existing task queues (taskqueue_swi and taskqueue_swi_giant) run in
software interrupt handlers, which wouldn't fix the problem at hand. So I
have created a new task queue, taskqueue_thread, that runs inside a kernel
thread. (It also runs outside of Giant -- clients must explicitly acquire
and release Giant in their taskqueue functions.)
scsi_cd.c: Remove sysctl variable creation code from cdregister(), and
move it to a new function, cdsysctlinit(). Queue
cdsysctlinit() to the taskqueue_thread taskqueue once we
have fully registered the cd(4) driver instance.
scsi_da.c: Remove sysctl variable creation code from daregister(), and
move it to move it to a new function, dasysctlinit().
Queue dasysctlinit() to the taskqueue_thread taskqueue once
we have fully registered the da(4) instance.
taskqueue.h: Declare the new taskqueue_thread taskqueue, update some
comments.
subr_taskqueue.c:
Create the new kernel thread taskqueue. This taskqueue
runs outside of Giant, so any functions queued to it would
need to explicitly acquire/release Giant if they need it.
cd.4: Update the cd(4) man page to talk about the minimum command
size sysctl/loader tunable. Also note that the changer
variables are available as loader tunables as well.
da.4: Update the da(4) man page to cover the retry_count,
default_timeout and minimum_cmd_size sysctl variables/loader
tunables. Remove references to /dev/r???, they aren't used
any longer.
cd.9: Update the cd(9) man page to describe the CD_Q_10_BYTE_ONLY
quirk.
taskqueue.9: Update the taskqueue(9) man page to describe the new thread
task queue, and the taskqueue_swi_giant queue.
MFC after: 3 days
2003-09-03 00:46:28 -04:00
|
|
|
* These queues are serviced by software interrupt handlers. To enqueue
|
|
|
|
|
* a task, call taskqueue_enqueue(taskqueue_swi, &task) or
|
|
|
|
|
* taskqueue_enqueue(taskqueue_swi_giant, &task).
|
2000-05-28 11:45:30 -04:00
|
|
|
*/
|
2003-02-25 22:15:42 -05:00
|
|
|
TASKQUEUE_DECLARE(swi_giant);
|
2000-05-28 11:45:30 -04:00
|
|
|
TASKQUEUE_DECLARE(swi);
|
|
|
|
|
|
Move dynamic sysctl(8) variable creation for the cd(4) and da(4) drivers
out of cdregister() and daregister(), which are run from interrupt context.
The sysctl code does blocking mallocs (M_WAITOK), which causes problems
if malloc(9) actually needs to sleep.
The eventual fix for this issue will involve moving the CAM probe process
inside a kernel thread. For now, though, I have fixed the issue by moving
dynamic sysctl variable creation for these two drivers to a task queue
running in a kernel thread.
The existing task queues (taskqueue_swi and taskqueue_swi_giant) run in
software interrupt handlers, which wouldn't fix the problem at hand. So I
have created a new task queue, taskqueue_thread, that runs inside a kernel
thread. (It also runs outside of Giant -- clients must explicitly acquire
and release Giant in their taskqueue functions.)
scsi_cd.c: Remove sysctl variable creation code from cdregister(), and
move it to a new function, cdsysctlinit(). Queue
cdsysctlinit() to the taskqueue_thread taskqueue once we
have fully registered the cd(4) driver instance.
scsi_da.c: Remove sysctl variable creation code from daregister(), and
move it to move it to a new function, dasysctlinit().
Queue dasysctlinit() to the taskqueue_thread taskqueue once
we have fully registered the da(4) instance.
taskqueue.h: Declare the new taskqueue_thread taskqueue, update some
comments.
subr_taskqueue.c:
Create the new kernel thread taskqueue. This taskqueue
runs outside of Giant, so any functions queued to it would
need to explicitly acquire/release Giant if they need it.
cd.4: Update the cd(4) man page to talk about the minimum command
size sysctl/loader tunable. Also note that the changer
variables are available as loader tunables as well.
da.4: Update the da(4) man page to cover the retry_count,
default_timeout and minimum_cmd_size sysctl variables/loader
tunables. Remove references to /dev/r???, they aren't used
any longer.
cd.9: Update the cd(9) man page to describe the CD_Q_10_BYTE_ONLY
quirk.
taskqueue.9: Update the taskqueue(9) man page to describe the new thread
task queue, and the taskqueue_swi_giant queue.
MFC after: 3 days
2003-09-03 00:46:28 -04:00
|
|
|
/*
|
|
|
|
|
* This queue is serviced by a kernel thread. To enqueue a task, call
|
|
|
|
|
* taskqueue_enqueue(taskqueue_thread, &task).
|
|
|
|
|
*/
|
|
|
|
|
TASKQUEUE_DECLARE(thread);
|
|
|
|
|
|
2003-09-05 19:09:22 -04:00
|
|
|
/*
|
|
|
|
|
* Queue for swi handlers dispatched from fast interrupt handlers.
|
|
|
|
|
* These are necessarily different from the above because the queue
|
|
|
|
|
* must be locked with spinlocks since sleep mutex's cannot be used
|
|
|
|
|
* from a fast interrupt handler context.
|
|
|
|
|
*/
|
|
|
|
|
TASKQUEUE_DECLARE(fast);
|
2006-01-10 01:31:12 -05:00
|
|
|
struct taskqueue *taskqueue_create_fast(const char *name, int mflags,
|
|
|
|
|
taskqueue_enqueue_fn enqueue,
|
2006-01-13 20:55:24 -05:00
|
|
|
void *context);
|
2003-09-05 19:09:22 -04:00
|
|
|
|
2000-05-28 11:45:30 -04:00
|
|
|
#endif /* !_SYS_TASKQUEUE_H_ */
|