diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2005-09-08 14:20:39 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2005-09-08 14:20:39 +0000 |
| commit | d04304d15550b2149a0bb9fccaa4ac50f29229c6 (patch) | |
| tree | 28d972cf1fcd2514ba5a8b5fca4778e5e77c5548 /sys/kern/kern_timeout.c | |
| parent | e1ab829ad27af06df1ee508492022d5ca8f3e34d (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_timeout.c')
| -rw-r--r-- | sys/kern/kern_timeout.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index f2fafbb85dfa..8e6b183bb76f 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -427,13 +427,14 @@ callout_handle_init(struct callout_handle *handle) * callout_pending() - returns truth if callout is still waiting for timeout * callout_deactivate() - marks the callout as having been serviced */ -void +int callout_reset(c, to_ticks, ftn, arg) struct callout *c; int to_ticks; void (*ftn)(void *); void *arg; { + int cancelled = 0; #ifdef notyet /* Some callers of timeout() do not hold Giant. */ if (c->c_mtx != NULL) @@ -448,14 +449,14 @@ callout_reset(c, to_ticks, ftn, arg) * can cancel the callout if it has not really started. */ if (c->c_mtx != NULL && !curr_cancelled) - curr_cancelled = 1; + cancelled = curr_cancelled = 1; if (wakeup_needed) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule. */ mtx_unlock_spin(&callout_lock); - return; + return (cancelled); } } if (c->c_flags & CALLOUT_PENDING) { @@ -465,6 +466,8 @@ callout_reset(c, to_ticks, ftn, arg) TAILQ_REMOVE(&callwheel[c->c_time & callwheelmask], c, c_links.tqe); + cancelled = 1; + /* * Part of the normal "stop a pending callout" process * is to clear the CALLOUT_ACTIVE and CALLOUT_PENDING @@ -490,6 +493,8 @@ callout_reset(c, to_ticks, ftn, arg) TAILQ_INSERT_TAIL(&callwheel[c->c_time & callwheelmask], c, c_links.tqe); mtx_unlock_spin(&callout_lock); + + return (cancelled); } int |
