summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-03-15 15:13:49 -0700
committerBrian Behlendorf <[email protected]>2009-03-15 15:13:49 -0700
commit7257ec41856cf54d47a85f786f06e5a3c330acfc (patch)
treedffd1f1c2f6472db2621603d1fd6eddb7104b7eb /include/sys
parent5b5f5685033b60cbd698c68b11d67150426587f5 (diff)
Fix taskq_wait() not waiting bug
I'm very surprised this has not surfaced until now. But the taskq_wait() implementation work only wait successfully the first time it was called. Subsequent usage of taskq_wait() on the taskq would not wait. The issue was caused by tq->tq_lowest_id being set to MAX_INT after the first wait completed. This caused subsequent waits which check that the waiting id is less than the lowest taskq id to always succeed. The fix is to ensure that tq->tq_lowest_id is never set larger than tq->tq_next.id. Additional fixes which were added to this patch include: 1) Fix a race by placing the taskq_wait_check() in the tq->tq_lock spinlock. 2) taskq_wait() should wait for the largest outstanding id. 3) Multiple spelling corrections. 4) Added taskq wait regression test to validate correct behavior.
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/taskq.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/taskq.h b/include/sys/taskq.h
index 0e78ea123..0b8623103 100644
--- a/include/sys/taskq.h
+++ b/include/sys/taskq.h
@@ -87,6 +87,7 @@ extern taskq_t *system_taskq;
extern taskqid_t __taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
extern taskq_t *__taskq_create(const char *, int, pri_t, int, int, uint_t);
extern void __taskq_destroy(taskq_t *);
+extern void __taskq_wait_id(taskq_t *, taskqid_t);
extern void __taskq_wait(taskq_t *);
extern int __taskq_member(taskq_t *, void *);