aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/spl/spl-condvar.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/spl/spl-condvar.c b/module/spl/spl-condvar.c
index 52131c1e8..e9f727d72 100644
--- a/module/spl/spl-condvar.c
+++ b/module/spl/spl-condvar.c
@@ -63,7 +63,8 @@ EXPORT_SYMBOL(__cv_init);
static int
cv_destroy_wakeup(kcondvar_t *cvp)
{
- if ((waitqueue_active(&cvp->cv_event)) ||
+ if ((cvp->cv_mutex != NULL) ||
+ (waitqueue_active(&cvp->cv_event)) ||
(atomic_read(&cvp->cv_waiters) > 0))
return 0;
@@ -81,9 +82,9 @@ __cv_destroy(kcondvar_t *cvp)
while (cv_destroy_wakeup(cvp) == 0)
wait_event_timeout(cvp->cv_destroy, cv_destroy_wakeup(cvp), 1);
- ASSERT(cvp->cv_mutex == NULL);
- ASSERT(atomic_read(&cvp->cv_waiters) == 0);
- ASSERT(!waitqueue_active(&cvp->cv_event));
+ ASSERT3P(cvp->cv_mutex, ==, NULL);
+ ASSERT3S(atomic_read(&cvp->cv_waiters), ==, 0);
+ ASSERT3S(waitqueue_active(&cvp->cv_event), ==, 0);
SEXIT;
}