Print this page
OS-6363 system went to dark side of moon for ~467 seconds OS-6404 ARC reclaim should throttle its calls to arc_kmem_reap_now() Reviewed by: Bryan Cantrill <bryan@joyent.com> Reviewed by: Dan McDonald <danmcd@joyent.com>
        
@@ -23,10 +23,11 @@
  * Use is subject to license terms.
  */
 /*
  * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright (c) 2017, Joyent, Inc.
  */
 
 #include <sys/taskq_impl.h>
 
 #include <sys/class.h>
@@ -206,10 +207,22 @@
         t->tqent_arg = arg;
         cv_signal(&tq->tq_dispatch_cv);
         mutex_exit(&tq->tq_lock);
 }
 
+boolean_t
+taskq_empty(taskq_t *tq)
+{
+        boolean_t rv;
+
+        mutex_enter(&tq->tq_lock);
+        rv = (tq->tq_task.tqent_next == &tq->tq_task) && (tq->tq_active == 0);
+        mutex_exit(&tq->tq_lock);
+
+        return (rv);
+}
+
 void
 taskq_wait(taskq_t *tq)
 {
         mutex_enter(&tq->tq_lock);
         while (tq->tq_task.tqent_next != &tq->tq_task || tq->tq_active != 0)