diff options
| -rw-r--r-- | sys/kern/kern_timeout.c | 6 | ||||
| -rw-r--r-- | sys/sys/callout.h | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 57be76224e8a..72b5302fd32c 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -242,11 +242,12 @@ callout_handle_init(struct callout_handle *handle) * callout_deactivate() - marks the callout as having been serviced */ void -callout_reset(c, to_ticks, ftn, arg) +_callout_reset(c, to_ticks, ftn, arg, flags) struct callout *c; int to_ticks; void (*ftn) __P((void *)); void *arg; + int flags; { int s; @@ -264,7 +265,8 @@ callout_reset(c, to_ticks, ftn, arg) to_ticks = 1; c->c_arg = arg; - c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING | + (flags & CALLOUT_MPSAFE)); c->c_func = ftn; c->c_time = ticks + to_ticks; TAILQ_INSERT_TAIL(&callwheel[c->c_time & callwheelmask], diff --git a/sys/sys/callout.h b/sys/sys/callout.h index a90285fe669d..a46055ebea87 100644 --- a/sys/sys/callout.h +++ b/sys/sys/callout.h @@ -79,9 +79,16 @@ extern struct mtx callout_lock; #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) void callout_init __P((struct callout *)); #define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING) -void callout_reset __P((struct callout *, int, void (*)(void *), void *)); +void _callout_reset __P((struct callout *, int, void (*)(void *), void *, + int)); void callout_stop __P((struct callout *)); +#define callout_reset(c, ticks, func, arg) \ + _callout_reset((c), (ticks), (func), (arg), 0) + +#define mp_callout_reset(c, ticks, func, arg) \ + _callout_reset((c), (ticks), (func), (arg), CALLOUT_MPSAFE) + #endif #endif /* _SYS_CALLOUT_H_ */ |
