Go to the documentation of this file.
133 #define MUTEX_INIT { { NULL } }
138 #define MUTEX_INIT_LOCKED { { MUTEX_LOCKED } }
145 #define MUTEX_LOCKED ((list_node_t *)-1)
void mutex_lock(mutex_t *mutex)
Locks a mutex, blocking.
Common macros and compiler attributes/pragmas configuration.
MAYBE_INLINE unsigned irq_disable(void)
This function sets the IRQ disable bit in the status register.
list_node_t queue
The process waiting queue of the mutex.
MAYBE_INLINE void irq_restore(unsigned state)
This function restores the IRQ disable bit in the status register to the value contained within passe...
static int mutex_trylock(mutex_t *mutex)
Tries to get a mutex, non-blocking.
static void mutex_init(mutex_t *mutex)
Initializes a mutex object.
void mutex_unlock_and_sleep(mutex_t *mutex)
Unlocks the mutex and sends the current thread to sleep.
struct list_node * next
pointer to next list entry
void mutex_unlock(mutex_t *mutex)
Unlocks the mutex.