diff options
-rw-r--r-- | sys/kern/kern_timeout.c | 9 | ||||
-rw-r--r-- | sys/sys/timeout.h | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 90b3f08e1ed..3237f60b600 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.32 2009/11/04 19:14:10 kettenis Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.33 2011/05/10 00:58:42 dlg Exp $ */ /* * Copyright (c) 2001 Thomas Nordin <nordin@openbsd.org> * Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org> @@ -263,16 +263,21 @@ timeout_add_nsec(struct timeout *to, int nsecs) timeout_add(to, to_ticks); } -void +int timeout_del(struct timeout *to) { + int ret = 0; + mtx_enter(&timeout_mutex); if (to->to_flags & TIMEOUT_ONQUEUE) { CIRCQ_REMOVE(&to->to_list); to->to_flags &= ~TIMEOUT_ONQUEUE; + ret = 1; } to->to_flags &= ~TIMEOUT_TRIGGERED; mtx_leave(&timeout_mutex); + + return (ret); } /* diff --git a/sys/sys/timeout.h b/sys/sys/timeout.h index 87ac0847615..98b984ffae3 100644 --- a/sys/sys/timeout.h +++ b/sys/sys/timeout.h @@ -1,4 +1,4 @@ -/* $OpenBSD: timeout.h,v 1.20 2010/05/26 17:50:00 deraadt Exp $ */ +/* $OpenBSD: timeout.h,v 1.21 2011/05/10 00:58:42 dlg Exp $ */ /* * Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -91,7 +91,7 @@ void timeout_add_sec(struct timeout *, int); void timeout_add_msec(struct timeout *, int); void timeout_add_usec(struct timeout *, int); void timeout_add_nsec(struct timeout *, int); -void timeout_del(struct timeout *); +int timeout_del(struct timeout *); void timeout_startup(void); |