aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2019-02-20 13:19:08 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-02-20 13:19:08 +0000
commit30d6475b3ffe9a6ee0c37f51b2b5c5c0453a5fd3 (patch)
treed05742bc88751e20ab1f5aabbd330e56f0178b83 /cddl/contrib/opensolaris/lib
parent03d89f7a04edf3a0315cd73b414d80a55f4babae (diff)
downloadsrc-30d6475b3ffe9a6ee0c37f51b2b5c5c0453a5fd3.tar.gz
src-30d6475b3ffe9a6ee0c37f51b2b5c5c0453a5fd3.zip
fix userland illumos taskq code to pass relative timeout to cv_timedwait
Unlike illumos, FreeBSD cv_timedwait requires a relative timeout. That applies both to the kernel illumos compatibility code and to the userland "fake kernel" code. MFC after: 2 weeks Sponsored by: Panzura
Notes
Notes: svn path=/head/; revision=344359
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/taskq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c b/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
index a8e5fc2a0256..595d766e93df 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
@@ -79,8 +79,13 @@ again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
* immediately retry the allocation.
*/
tq->tq_maxalloc_wait++;
+#ifdef __FreeBSD__
+ rv = cv_timedwait(&tq->tq_maxalloc_cv,
+ &tq->tq_lock, hz);
+#else
rv = cv_timedwait(&tq->tq_maxalloc_cv,
&tq->tq_lock, ddi_get_lbolt() + hz);
+#endif
tq->tq_maxalloc_wait--;
if (rv > 0)
goto again; /* signaled */