Mutex implementation.
More...
Go to the source code of this file.
Mutex implementation.
- Copyright
- 2019-2020, Remi Andruccioli remi..nosp@m.andr.nosp@m.uccio.nosp@m.li@g.nosp@m.mail..nosp@m.com
This file describes the implementation of mutexes. Mutexes in Lazuli are implemented as blocking.
Definition in file mutex.c.
◆ InitMutex()
static void InitMutex |
( |
Lz_Mutex *const |
mutex, |
|
|
const Lz_Mutex *const |
initValue |
|
) |
| |
|
static |
Initialize a mutex in a given state.
- Parameters
-
mutex | A pointer to the mutex to initialize. |
initValue | A valid pointer to a mutex in the desired state. |
Definition at line 30 of file mutex.c.
◆ WaitMutex()
static void WaitMutex |
( |
Lz_Mutex *const |
mutex | ) |
|
|
static |
Set the task to wait for a given mutex to be unlocked.
- Parameters
-
mutex | a valid pointer to the mutex to wait. |
Definition at line 47 of file mutex.c.
◆ 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.