- NetBSD Manual Pages
KPREEMPT(9) NetBSD Kernel Developer's Manual KPREEMPT(9)
Powered by man-cgi (2021-03-02).
Maintained for NetBSD
by Kimmo Suominen.
Based on man-cgi by Panagiotis Christias.
kpreempt -- control kernel preemption
These functions are used to control kernel preemption of the calling LWP.
On architectures where kernel preemption is not supported natively, these
functions may still be used.
It should be noted that kernel preemption is also disabled when holding
the interrupt priority level above IPL_NONE, e.g. using spl(9) or spin-
ning mutex(9) calls or holding kernel_lock (indicating that the code is
not MT safe).
kpreempt_disable() disables kernel preemption of the calling LWP. Note
that disabling kernel preemption can prevent LWPs with higher priorities
kpreempt_enable() enables kernel preemption of the calling LWP, which was
previously disabled by kpreempt_disable().
kpreempt_disable() and kpreempt_enable() can be nested.
kpreempt_disabled() returns true if preemption of the calling LWP is dis-
abled. It is only for diagnostic purpose.
intro(9), mutex(9), spl(9)
NetBSD 9.0 February 16, 2010 NetBSD 9.0