diff options
| author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2009-08-17 09:03:47 +0000 |
|---|---|---|
| committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2009-08-17 09:03:47 +0000 |
| commit | e43f1736025f4815411d70c690b31e86af0255c6 (patch) | |
| tree | 5cecd6c9f52336c4e919e1f9fa0000d39c7a5ec4 /sys/kern/subr_taskqueue.c | |
| parent | ea5f504fed085eba4540b59651fbd57056995284 (diff) | |
Notes
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 e49c8024ecfc..bec3b566ea33 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); +} |
