diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-03-15 16:47:51 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-03-15 16:47:51 +0000 |
commit | da62a1ab881ab259e401bd5f4d66414b93b75c98 (patch) | |
tree | ce47956949504d97de9851d7fde71332159cd2dd /sys/kern/kern_timeout.c | |
parent | d0f7da8066530d27e468fad2306b316f799616fb (diff) |
Triggered mechanism allows a handler to figure out whether a given
timeout is actually executing.
Diffstat (limited to 'sys/kern/kern_timeout.c')
-rw-r--r-- | sys/kern/kern_timeout.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 7b992cfd32e..04e74fd62c2 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.6 2001/02/16 13:47:40 espie Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.7 2001/03/15 16:47:50 csapuntz Exp $ */ /* * Copyright (c) 2000 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -134,6 +134,7 @@ timeout_add(new, to_ticks) new->to_flags |= TIMEOUT_ONQUEUE; /* Initialize the time here, it won't change. */ new->to_time = to_ticks + ticks; + new->to_flags &= ~TIMEOUT_TRIGGERED; /* * Walk the list of pending timeouts and find an entry which @@ -163,6 +164,7 @@ timeout_del(to) TAILQ_REMOVE(&timeout_todo, to, to_list); to->to_flags &= ~TIMEOUT_ONQUEUE; } + to->to_flags &= ~TIMEOUT_TRIGGERED; timeout_list_unlock(s); } @@ -199,6 +201,7 @@ softclock() TAILQ_REMOVE(&timeout_todo, to, to_list); to->to_flags &= ~TIMEOUT_ONQUEUE; + to->to_flags |= TIMEOUT_TRIGGERED; fn = to->to_func; arg = to->to_arg; |