Temporarily move taskq+util to libzpool until that directory is broken in to lib...
[zfs.git] / zfs / lib / libzpool / taskq.c
index 6f6cfc2..93acdcf 100644 (file)
  * CDDL HEADER END
  */
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-
-
 #include <sys/zfs_context.h>
 
 int taskq_now;
+taskq_t *system_taskq;
 
 typedef struct task {
        struct task     *task_next;
@@ -196,8 +195,8 @@ taskq_create(const char *name, int nthreads, pri_t pri,
        }
 
        for (t = 0; t < nthreads; t++)
-               VERIFY(thr_create(0, 0, taskq_thread,
-                   tq, THR_BOUND, &tq->tq_threadlist[t]) == 0);
+               (void) thr_create(0, 0, taskq_thread,
+                   tq, THR_BOUND, &tq->tq_threadlist[t]);
 
        return (tq);
 }
@@ -227,7 +226,7 @@ taskq_destroy(taskq_t *tq)
        mutex_exit(&tq->tq_lock);
 
        for (t = 0; t < nthreads; t++)
-               VERIFY(thr_join(tq->tq_threadlist[t], NULL, NULL) == 0);
+               (void) thr_join(tq->tq_threadlist[t], NULL, NULL);
 
        kmem_free(tq->tq_threadlist, nthreads * sizeof (thread_t));
 
@@ -253,3 +252,10 @@ taskq_member(taskq_t *tq, void *t)
 
        return (0);
 }
+
+void
+system_taskq_init(void)
+{
+       system_taskq = taskq_create("system_taskq", 64, minclsyspri, 4, 512,
+           TASKQ_DYNAMIC | TASKQ_PREPOPULATE);
+}