diff options
author | scottl <scottl@FreeBSD.org> | 2006-01-14 01:55:24 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2006-01-14 01:55:24 +0000 |
commit | 645eb22044ffa13d5de0294dc16c9c7aefa7c5b0 (patch) | |
tree | f5229c8522204692d0896701c0159d45163983de /sys/dev/acpica/Osd | |
parent | 275b7c6a54522a88888b37fba8ce842fcb6d83ca (diff) | |
download | FreeBSD-src-645eb22044ffa13d5de0294dc16c9c7aefa7c5b0.zip FreeBSD-src-645eb22044ffa13d5de0294dc16c9c7aefa7c5b0.tar.gz |
Add the following to the taskqueue api:
taskqueue_start_threads(struct taskqueue **, int count, int pri,
const char *name, ...);
This allows the creation of 1 or more threads that will service a single
taskqueue. Also rework the taskqueue_create() API to remove the API change
that was introduced a while back. Creating a taskqueue doesn't rely on
the presence of a process structure, and the proc mechanics are much better
encapsulated in taskqueue_start_threads(). Also clean up the
taskqueue_terminate() and taskqueue_free() functions to safely drain
pending tasks and remove all associated threads.
The TASKQUEUE_DEFINE and TASKQUEUE_DEFINE_THREAD macros have been changed
to use the new API, but drivers compiled against the old definitions will
still work. Thus, recompiling drivers is not a strict requirement.
Diffstat (limited to 'sys/dev/acpica/Osd')
-rw-r--r-- | sys/dev/acpica/Osd/OsdSchedule.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c index f1e84e4..1e8aeca 100644 --- a/sys/dev/acpica/Osd/OsdSchedule.c +++ b/sys/dev/acpica/Osd/OsdSchedule.c @@ -65,31 +65,8 @@ struct acpi_task_ctx { void *at_context; }; -/* - * Private task queue definition for ACPI - */ -static struct proc * -acpi_task_start_threads(struct taskqueue **tqp) -{ - struct proc *acpi_kthread_proc; - int err, i; - - KASSERT(*tqp != NULL, ("acpi taskqueue not created before threads")); - - /* Start one or more threads to service our taskqueue. */ - for (i = 0; i < acpi_max_threads; i++) { - err = kthread_create(taskqueue_thread_loop, tqp, &acpi_kthread_proc, - 0, 0, "acpi_task%d", i); - if (err) { - printf("%s: kthread_create failed (%d)\n", __func__, err); - break; - } - } - return (acpi_kthread_proc); -} - TASKQUEUE_DEFINE(acpi, taskqueue_thread_enqueue, &taskqueue_acpi, - taskqueue_acpi_proc = acpi_task_start_threads(&taskqueue_acpi)); + taskqueue_start_threads(&taskqueue_acpi, 3, PWAIT, "acpi_task")); /* * Bounce through this wrapper function since ACPI-CA doesn't understand |