|
ginnOS
The reference: libc, the libraries and the kernel
|
#include "kernel/sync/mutex.h"#include "arch/arch.h"#include "kernel/assert.h"#include "kernel/process/process.h"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). | |
| 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. |