The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
mutex_t Struct Reference

sleeping mutex for long critical sections in process context (filesystem and disk I/O). More...

#include </home/runner/work/ginnOS-docs/ginnOS-docs/ginnOS/src/kernel/sync/mutex.h>

Data Fields

volatile bool locked
struct process * owner
wait_queue_t waiters
spinlock_t lock

Detailed Description

sleeping mutex for long critical sections in process context (filesystem and disk I/O).

a process that finds the mutex held blocks on its wait queue instead of spinning or masking interrupts, so interrupts and other processes keep running while the holder works.

never take a mutex from an interrupt handler, and never block on one while holding a spinlock. use a spinlock for short sections shared with IRQs. a mutex. zero-initialized (or MUTEX_INIT) means unlocked.

Field Documentation

◆ locked

volatile bool mutex_t::locked

◆ owner

struct process* mutex_t::owner

◆ waiters

wait_queue_t mutex_t::waiters

◆ lock

spinlock_t mutex_t::lock

The documentation for this struct was generated from the following file: