|
ginnOS
The reference: libc, the libraries and the kernel
|
Go to the source code of this file.
Data Structures | |
| struct | mutex_t |
| sleeping mutex for long critical sections in process context (filesystem and disk I/O). More... | |
Macros | |
| #define | MUTEX_INIT {false, 0, {0}, {0, 0, 0}} |
Functions | |
| void | mutex_init (mutex_t *mutex) |
| initialize a mutex to the unlocked state. | |
| void | mutex_lock (mutex_t *mutex) |
| acquire a mutex, sleeping until it is free. | |
| void | mutex_unlock (mutex_t *mutex) |
| release a mutex held by the current process and wake one waiter. | |
| bool | mutex_held (const mutex_t *mutex) |
| check whether the current process holds a mutex (for assertions). | |
| #define MUTEX_INIT {false, 0, {0}, {0, 0, 0}} |
| void mutex_init | ( | mutex_t * | mutex | ) |
initialize a mutex to the unlocked state.
| mutex | the mutex to initialize. |
| void mutex_lock | ( | mutex_t * | mutex | ) |
acquire a mutex, sleeping until it is free.
not recursive.
| mutex | the mutex to acquire. |
| void mutex_unlock | ( | mutex_t * | mutex | ) |
release a mutex held by the current process and wake one waiter.
| mutex | the mutex to release. |