Keyronex Keyronex manual pages

KSEMAPHORE(9) Kernel Developer's Manual KSEMAPHORE(9)

ksemaphore, ke_semaphore_init, ke_semaphore_reset, ke_semaphore_release, ke_semaphore_release_maxonedispatcher mutex object

#include <kdk/kern.h>

void
ke_semaphore_init(ksemaphore_t *sem, unsigned count);

void
ke_semaphore_reset(ksemaphore_t *sem, unsigned count);

void
ke_semaphore_release(ksemaphore_t *sem, unsigned adjustment);

void
ke_semaphore_release_maxone(ksemaphore_t *sem);

The dispatcher semaphore object is a dispatcher object that can be waited on by ke_wait(9), defined by the ksemaphore_t type.

The semaphore object is a counter that can be incremented and decremented. When the counter is zero, waiters will be put to sleep until the counter is incremented.

Waiters sleep until the counter is positive, and the counter is decremented when a waiter is satisfied.

The () function initialises a semaphore object, setting its counter to the value specified by the count parameter.

The () function resets a semaphore object, setting its counter to the value specified by the count parameter.

The () function increments the counter of a semaphore object by the value specified by the adjustment parameter.

The () function increments the counter of a semaphore object by one only if the counter was zero.

All these functions may be called from any context at or below kIPLDPC.

These functions are implemented in kernel/kern/semaphore.c.

The interface is declared in kernel/include/kdk/kern.h.

ke_wait(9),

These interfaces have always been in Keyronex.

October 6, 2024 Debian