aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Holmqvist <fredrik.holmqvist@gmail.com>2012-07-18 17:09:36 +0200
committerFredrik Holmqvist <fredrik.holmqvist@gmail.com>2012-07-18 17:09:36 +0200
commita2e7d8df7bf39721a597b0473831f25813d71b0e (patch)
tree3fb7e75cb35f88eb9f4481bd4acf60c3cdb4fa20
parent4feeeb4a8fedd4089e4d874d6e2c5a6ce8185bb5 (diff)
callout_schedule uses ticks as timeunit, not usecs.hrev44350
As suggested by Rene Gollent, we used ticks as usecs.
-rw-r--r--src/libs/compat/freebsd_network/callout.cpp10
-rw-r--r--src/libs/compat/freebsd_network/compat/sys/callout.h5
2 files changed, 8 insertions, 7 deletions
diff --git a/src/libs/compat/freebsd_network/callout.cpp b/src/libs/compat/freebsd_network/callout.cpp
index 1541580500..da06a5b310 100644
--- a/src/libs/compat/freebsd_network/callout.cpp
+++ b/src/libs/compat/freebsd_network/callout.cpp
@@ -172,7 +172,7 @@ callout_init_mtx(struct callout *c, struct mtx *mtx, int flags)
int
-callout_reset(struct callout *c, int when, void (*func)(void *), void *arg)
+callout_reset(struct callout *c, int ticks, void (*func)(void *), void *arg)
{
int canceled = callout_stop(c);
@@ -183,12 +183,12 @@ callout_reset(struct callout *c, int when, void (*func)(void *), void *arg)
TRACE("callout_reset %p, func %p, arg %p\n", c, c->c_func, c->c_arg);
- if (when >= 0) {
+ if (ticks >= 0) {
// reschedule or add this timer
if (c->due <= 0)
list_add_item(&sTimers, c);
- c->due = system_time() + when;
+ c->due = system_time() + ticks_to_usecs(ticks);
// notify timer about the change if necessary
if (sTimeout > c->due)
@@ -200,9 +200,9 @@ callout_reset(struct callout *c, int when, void (*func)(void *), void *arg)
int
-callout_schedule(struct callout *callout, int toTicks)
+callout_schedule(struct callout *callout, int ticks)
{
- return callout_reset(callout, toTicks, callout->c_func, callout->c_arg);
+ return callout_reset(callout, ticks, callout->c_func, callout->c_arg);
}
diff --git a/src/libs/compat/freebsd_network/compat/sys/callout.h b/src/libs/compat/freebsd_network/compat/sys/callout.h
index 50909aa95f..9d4da3b944 100644
--- a/src/libs/compat/freebsd_network/compat/sys/callout.h
+++ b/src/libs/compat/freebsd_network/compat/sys/callout.h
@@ -30,8 +30,9 @@ struct callout {
void callout_init(struct callout *c, int mpsafe);
void callout_init_mtx(struct callout *c, struct mtx *mutex, int flags);
-int callout_schedule(struct callout *c, int when);
-int callout_reset(struct callout *c, int when, void (*func)(void *), void *arg);
+/* Time values are in ticks, see compat/sys/kernel.h for its definition */
+int callout_schedule(struct callout *c, int ticks);
+int callout_reset(struct callout *c, int ticks, void (*func)(void *), void *arg);
int callout_pending(struct callout *c);
int callout_active(struct callout *c);