]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a special meaning to the negative ticks argument for
authorkib <kib@FreeBSD.org>
Tue, 20 Nov 2012 15:33:48 +0000 (15:33 +0000)
committerkib <kib@FreeBSD.org>
Tue, 20 Nov 2012 15:33:48 +0000 (15:33 +0000)
commitf0eb44bc70263f6f188d8f07d367628d2efb6716
tree444d06ff6a3b2b0eef2bda7713393644d7a67fe5
parentf31aa350da4c1b4c93b747fa9a4044dd1a6eb349
Add a special meaning to the negative ticks argument for
taskqueue_enqueue_timeout().  Do not rearm the callout if it is
already armed and the ticks is negative.  Otherwise rearm it to fire
in abs(ticks) ticks in the future.

The intended use is to call taskqueue_enqueue_timeout() for the given
timeout_task with the same negative ticks argument.  As result, the
task is scheduled to execute not further than abs(ticks) ticks in
future, and the consequent enqueues are coalesced until the already
scheduled task is finished.

Reviewed by: rwatson
Tested by: Markus Gebert <markus.gebert@hostpoint.ch>
MFC after: 2 weeks
sys/kern/subr_taskqueue.c