]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r306441 and r306634:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 10 Oct 2016 11:25:11 +0000 (11:25 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 10 Oct 2016 11:25:11 +0000 (11:25 +0000)
commit10d215cb89ef895e7c0015a02b31bab2d48302b9
treec1f4fcc78b930dbe5a9b97fff0e241633b86eff6
parentbb63374e2ffcb269b3ca565e4bd18ee2edb70d9f
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

git-svn-id: svn://svn.freebsd.org/base/stable/10@306947 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
share/man/man9/taskqueue.9
sys/kern/subr_taskqueue.c