summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-10-10 11:22:11 +0000
committerhselasky <hselasky@FreeBSD.org>2016-10-10 11:22:11 +0000
commit9fbf711ba2fa97f4b2274ba8d15362ccf04a953f (patch)
tree42cc1155205b79d73989e6022fb0c5c991399a7d /share
parent4879b7e1393555cd61cdb72e4519a59b307d32c6 (diff)
downloadFreeBSD-src-9fbf711ba2fa97f4b2274ba8d15362ccf04a953f.zip
FreeBSD-src-9fbf711ba2fa97f4b2274ba8d15362ccf04a953f.tar.gz
MFC r306441 and r306634:
While draining a timeout task prevent the taskqueue_enqueue_timeout() function from restarting the timer. Commonly taskqueue_enqueue_timeout() is called from within the task function itself without any checks for teardown. Then it can happen the timer stays active after the return of taskqueue_drain_timeout(), because the timeout and task is drained separately. This patch factors out the teardown flag into the timeout task itself, allowing existing code to stay as-is instead of applying a teardown flag to each and every of the timeout task consumers. Add assert to taskqueue_drain_timeout() which prevents parallel execution on the same timeout task. Update manual page documenting the return value of taskqueue_enqueue_timeout(). Differential Revision: https://reviews.freebsd.org/D8012 Reviewed by: kib, trasz
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/taskqueue.92
1 files changed, 2 insertions, 0 deletions
diff --git a/share/man/man9/taskqueue.9 b/share/man/man9/taskqueue.9
index 5ee7fc8..312cffe 100644
--- a/share/man/man9/taskqueue.9
+++ b/share/man/man9/taskqueue.9
@@ -223,6 +223,8 @@ Otherwise, the task is scheduled for enqueueing in the future,
after the absolute value of
.Va ticks
is passed.
+This function returns -1 if the task is being drained.
+Otherwise, the number of pending calls is returned.
.Pp
The
.Fn taskqueue_cancel
OpenPOWER on IntegriCloud