created | 2024-02-13T04:54:43Z |
---|---|
begin | 2024-02-09T15:22:41Z |
end | 2024-02-09T16:52:58Z |
path | src/sys |
commits | 1 |
date | 2024-02-09T16:52:58Z | |||
---|---|---|---|---|
author | cheloha | |||
files | src/sys/kern/kern_clockintr.c | log | diff | annotate |
src/sys/sys/clockintr.h | log | diff | annotate | |
message |
clockintr: add clockintr_unbind() The clockintr_unbind() function cancels any pending execution of the given clock interrupt object's callback and severs the binding between the object and its host CPU. Upon return from clockintr_unbind(), the clock interrupt object may be rebound with a call to clockintr_bind(). The optional CL_BARRIER flag tells clockintr_unbind() to block if the clockintr's callback function is executing at the moment of the call. This is useful when the clockintr's arg is a shared reference and the caller needs to be certain the reference is inactive. Now that clockintrs can be bound and unbound repeatedly, there is more room for error. To help catch programmer errors, clockintr_unbind() sets cl_queue to NULL. Calls to other API functions after a clockintr is unbound will then fault on a NULL dereference. clockintr_bind() also KASSERTs that cl_queue is NULL to ensure the clockintr is not already bound. These checks are not perfect, but they do catch some common errors. With input from mpi@. Thread: https://marc.info/?l=openbsd-tech&m=170629367121800&w=2 ok mpi@ |