diff options
author | pjd <pjd@FreeBSD.org> | 2009-08-17 09:01:20 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2009-08-17 09:01:20 +0000 |
commit | ea8df6fcea7daa26626d5ebfe923d8bafdb0434a (patch) | |
tree | 9ffe4e19c60755bbb3d41be7adb8eb9e85d76ef0 /sys/kern/subr_taskqueue.c | |
parent | 3220ee349be0d1b1fa8d9f4a19b5a763a25f069f (diff) | |
download | FreeBSD-src-ea8df6fcea7daa26626d5ebfe923d8bafdb0434a.zip FreeBSD-src-ea8df6fcea7daa26626d5ebfe923d8bafdb0434a.tar.gz |
Remove OpenSolaris taskq port (it performs very poorly in our kernel) and
replace it with wrappers around our taskqueue(9).
To make it possible implement taskqueue_member() function which returns 1
if the given thread was created by the given taskqueue.
Approved by: re (kib)
Diffstat (limited to 'sys/kern/subr_taskqueue.c')
-rw-r--r-- | sys/kern/subr_taskqueue.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index e49c802..bec3b56 100644 --- a/sys/kern/subr_taskqueue.c +++ b/sys/kern/subr_taskqueue.c @@ -472,3 +472,23 @@ taskqueue_fast_run(void *dummy) TASKQUEUE_FAST_DEFINE(fast, taskqueue_fast_enqueue, NULL, swi_add(NULL, "Fast task queue", taskqueue_fast_run, NULL, SWI_TQ_FAST, INTR_MPSAFE, &taskqueue_fast_ih)); + +int +taskqueue_member(struct taskqueue *queue, struct thread *td) +{ + int i, j, ret = 0; + + TQ_LOCK(queue); + for (i = 0, j = 0; ; i++) { + if (queue->tq_threads[i] == NULL) + continue; + if (queue->tq_threads[i] == td) { + ret = 1; + break; + } + if (++j >= queue->tq_tcount) + break; + } + TQ_UNLOCK(queue); + return (ret); +} |