| KMUTEX(9) | Kernel Developer's Manual | KMUTEX(9) |
kmutex,
ke_mutex_init,
ke_mutex_release,
ke_mutex_assert_held —
dispatcher mutex object
#include
<kdk/kern.h>
void
ke_mutex_init(kevent_t
*mutex);
void
ke_mutex_release(kmutex_t
*mutex);
void
ke_mutex_assert_held(kmutex_t
*mutex);
The mutex object is in one of two states: held or not held. While a mutex object is held, it cannot be acquired by another thread; the thread that holds the mutex must release it first, and until then, waiters will be put to sleep.
The
ke_mutex_init()
function initialises a mutex object, setting its state to not held.
The
ke_mutex_release()
function releases a mutex object, setting its state to not held. It is an
error to release a mutex that is not held.
The
ke_mutex_assert_held()
macro asserts that the mutex is held by the current thread.
All these functions may be called from any context at or below
kIPLDPC.
These functions are implemented in kernel/kern/mutex.c.
The interface is declared in kernel/include/kdk/kern.h.
These interfaces have always been in Keyronex.
| October 6, 2024 | Debian |