Mutexes interface.
More...
#include <stdint.h>
#include <Lazuli/common.h>
#include <Lazuli/list.h>
Go to the source code of this file.
Mutexes interface.
- Copyright
- 2019-2020, Remi Andruccioli remi..nosp@m.andr.nosp@m.uccio.nosp@m.li@g.nosp@m.mail..nosp@m.com
Describes the interface for mutexes. Mutexes in Lazuli are implemented as blocking.
Definition in file mutex.h.
◆ LZ_MUTEX_INIT
Define the value to initialize a Lz_Mutex in the unlocked state.
This macro constant must be used to statically initialize a declared mutex.
Definition at line 39 of file mutex.h.
◆ LZ_MUTEX_INIT_LOCKED
Define the value to initialize a Lz_Mutex in the locked state.
This macro constant must be used to statically initialize a declared mutex.
Definition at line 47 of file mutex.h.
◆ Lz_Mutex_Init()
void Lz_Mutex_Init |
( |
Lz_Mutex *const |
mutex | ) |
|
Initialize an already allocated Lz_Mutex.
The mutex will be initialized in an unlocked state.
- Parameters
-
mutex | A pointer to the Lz_Mutex to initialize. |
- Note
- The calling task will abort if configuration macro LZ_CONFIG_CHECK_NULL_PARAMETERS_IN_MUTEXES is set to 1 and the parameter
mutex
is NULL.
Definition at line 61 of file mutex.c.
◆ Lz_Mutex_InitLocked()
void Lz_Mutex_InitLocked |
( |
Lz_Mutex *const |
mutex | ) |
|
Initialize an already allocated Lz_Mutex.
The mutex will be initialized in a locked state.
- Parameters
-
mutex | A pointer to the Lz_Mutex to initialize. |
- Note
- The calling task will abort if configuration macro LZ_CONFIG_CHECK_NULL_PARAMETERS_IN_MUTEXES is set to 1 and the parameter
mutex
is NULL.
Definition at line 69 of file mutex.c.
◆ Lz_Mutex_Lock()
void Lz_Mutex_Lock |
( |
Lz_Mutex *const |
mutex | ) |
|
Lock the mutex and enter critical section.
- Parameters
-
- Note
- The calling task will abort if configuration macro LZ_CONFIG_CHECK_NULL_PARAMETERS_IN_MUTEXES is set to 1 and the parameter
mutex
is NULL.
Definition at line 77 of file mutex.c.
◆ Lz_Mutex_Unlock()
void Lz_Mutex_Unlock |
( |
Lz_Mutex *const |
mutex | ) |
|
Unlock the mutex and leave critical section.
- Parameters
-
mutex | A pointer to the Lz_Mutex to unlock. |
- Note
- The calling task will abort if configuration macro LZ_CONFIG_CHECK_NULL_PARAMETERS_IN_MUTEXES is set to 1 and the parameter
mutex
is NULL.
Definition at line 91 of file mutex.c.