Changeset View
Changeset View
Standalone View
Standalone View
head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | |||||
taskq_wait(taskq_t *tq) | taskq_wait(taskq_t *tq) | ||||
{ | { | ||||
mutex_enter(&tq->tq_lock); | mutex_enter(&tq->tq_lock); | ||||
while (tq->tq_task.tqent_next != &tq->tq_task || tq->tq_active != 0) | while (tq->tq_task.tqent_next != &tq->tq_task || tq->tq_active != 0) | ||||
cv_wait(&tq->tq_wait_cv, &tq->tq_lock); | cv_wait(&tq->tq_wait_cv, &tq->tq_lock); | ||||
mutex_exit(&tq->tq_lock); | mutex_exit(&tq->tq_lock); | ||||
} | } | ||||
void | |||||
taskq_wait_id(taskq_t *tq, taskqid_t id) | |||||
{ | |||||
taskq_wait(tq); | |||||
} | |||||
static void * | static void * | ||||
taskq_thread(void *arg) | taskq_thread(void *arg) | ||||
{ | { | ||||
taskq_t *tq = arg; | taskq_t *tq = arg; | ||||
taskq_ent_t *t; | taskq_ent_t *t; | ||||
boolean_t prealloc; | boolean_t prealloc; | ||||
mutex_enter(&tq->tq_lock); | mutex_enter(&tq->tq_lock); | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |