clockintr: add clockintr_cancel_locked()
authorcheloha <cheloha@openbsd.org>
Tue, 4 Apr 2023 21:49:10 +0000 (21:49 +0000)
committercheloha <cheloha@openbsd.org>
Tue, 4 Apr 2023 21:49:10 +0000 (21:49 +0000)
commita7d6b88a0050c3073198c7aa0e76267f212fee0f
tree99e53635544f12d5d7ed9603d11cc0b87a045f5a
parent8ced0038f0c169a94494b9938dfdb7410df6967c
clockintr: add clockintr_cancel_locked()

Move the CLST_PENDING check and TAILQ_REMOVE() in
clockintr_schedule_locked() into a dedicated function,
clockintr_cancel_locked().  clockintr_schedule_locked() no longer
implicitly cancels a pending clockintr: it is the caller's
responsibility to check for CLST_PENDING and cancel any pending
expiration before calling clockintr_schedule_locked().  We can skip
the CLST_PENDING check during the dispatch loop because we know for
certain the clockintr in question is pending.

This is more verbose but I think it is less surprising.  Both
functions do one thing.
sys/kern/kern_clockintr.c