svn commit: r243850 - stable/9/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Tue Dec 4 00:54:49 UTC 2012
Author: kib
Date: Tue Dec 4 00:54:49 2012
New Revision: 243850
URL: http://svnweb.freebsd.org/changeset/base/243850
Log:
MFC r243341:
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.
Modified:
stable/9/sys/kern/subr_taskqueue.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/kern/subr_taskqueue.c
==============================================================================
--- stable/9/sys/kern/subr_taskqueue.c Tue Dec 4 00:53:20 2012 (r243849)
+++ stable/9/sys/kern/subr_taskqueue.c Tue Dec 4 00:54:49 2012 (r243850)
@@ -252,9 +252,13 @@ taskqueue_enqueue_timeout(struct taskque
} else {
queue->tq_callouts++;
timeout_task->f |= DT_CALLOUT_ARMED;
+ if (ticks < 0)
+ ticks = -ticks; /* Ignore overflow. */
+ }
+ if (ticks > 0) {
+ callout_reset(&timeout_task->c, ticks,
+ taskqueue_timeout_func, timeout_task);
}
- callout_reset(&timeout_task->c, ticks, taskqueue_timeout_func,
- timeout_task);
}
TQ_UNLOCK(queue);
return (res);
More information about the svn-src-all
mailing list