diff options
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/os/taskq.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/os/taskq.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c b/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c index 1558c1f..154ead4 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c +++ b/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c @@ -794,6 +794,27 @@ taskq_resume(taskq_t *tq) rw_exit(&tq->tq_threadlock); } + +int +taskq_member(taskq_t *tq, kthread_t *thread) +{ + if (tq->tq_nthreads == 1) + return (tq->tq_thread == thread); + else { + int i, found = 0; + + mutex_enter(&tq->tq_lock); + for (i = 0; i < tq->tq_nthreads; i++) { + if (tq->tq_threadlist[i] == thread) { + found = 1; + break; + } + } + mutex_exit(&tq->tq_lock); + return (found); + } +} + /* * Worker thread for processing task queue. */ |