A semaphore is an unsigned integer that blocks the kernel thread if the number would become negative. This API supports static initialization and does not require deinitialization.

Fields

mutex: Mutex = .{ },
cond: Condition = .{ },
permits: usize = 0,

It is OK to initialize this field to any value.

Functions

fn post(sem: *Semaphore) void

No documentation provided.

fn wait(sem: *Semaphore) void

No documentation provided.