Hans Petter Selasky 99eca1b2b3 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
MFC after:	1 week
2016-09-29 10:38:20 +00:00
..
2015-04-22 14:38:58 +00:00
2016-06-09 18:27:41 +00:00
2016-09-18 07:37:00 +00:00
2016-07-27 11:40:06 +00:00
2016-08-30 19:26:07 +00:00
2016-07-26 17:23:49 +00:00
2016-04-29 22:15:33 +00:00
2016-04-14 17:07:26 +00:00
2016-08-17 10:14:22 +00:00
2016-08-11 07:58:23 +00:00
2016-09-23 04:45:11 +00:00