Go to the documentation of this file.
30 #include <stdatomic.h>
72 #define RMUTEX_INIT { MUTEX_INIT, 0, ATOMIC_VAR_INIT(KERNEL_PID_UNDEF) }
84 *rmutex = empty_rmutex;
void rmutex_unlock(rmutex_t *rmutex)
Unlocks the recursive mutex.
#define RMUTEX_INIT
Static initializer for rmutex_t.
int rmutex_trylock(rmutex_t *rmutex)
Tries to get a recursive mutex, non-blocking.
struct rmutex_t rmutex_t
Mutex structure.
mutex_t mutex
The mutex used for locking.
Scheduler API definition.
void rmutex_lock(rmutex_t *rmutex)
Locks a recursive mutex, blocking.
C++ compatibility of default C11 atomics types.
Mutex for thread synchronization.
Type with the same alignment and size as atomic_int_least16_t
uint16_t refcount
Number of locks owned by the thread owner.
static void rmutex_init(rmutex_t *rmutex)
Initializes a recursive mutex object.
atomic_int_least16_t owner
Owner thread of the mutex.