UbixOS  2.0
Collaboration diagram for Mutexes:

Functions

void sys_mutex_free (sys_mutex_t *mutex)
 
void sys_mutex_lock (sys_mutex_t *mutex)
 
err_t sys_mutex_new (sys_mutex_t *mutex)
 
void sys_mutex_set_invalid (sys_mutex_t *mutex)
 
void sys_mutex_unlock (sys_mutex_t *mutex)
 
int sys_mutex_valid (sys_mutex_t *mutex)
 

Detailed Description

Mutexes are recommended to correctly handle priority inversion, especially if you use LWIP_CORE_LOCKING .

Function Documentation

◆ sys_mutex_free()

void sys_mutex_free ( sys_mutex_t mutex)

Delete a semaphore

Parameters
mutexthe mutex to delete

Definition at line 148 of file sys_arch.c.

References mutex, ubthread_mutex_list::mutex, and ubthread_mutex_destroy().

Here is the call graph for this function:

◆ sys_mutex_lock()

void sys_mutex_lock ( sys_mutex_t mutex)

Lock a mutex

Parameters
mutexthe mutex to lock

Definition at line 152 of file sys_arch.c.

References mutex, ubthread_mutex_list::mutex, and ubthread_mutex_lock().

Referenced by mem_malloc().

Here is the call graph for this function:

◆ sys_mutex_new()

err_t sys_mutex_new ( sys_mutex_t mutex)

Create a new mutex. Note that mutexes are expected to not be taken recursively by the lwIP code, so both implementation types (recursive or non-recursive) should work.

Parameters
mutexpointer to the mutex to create
Returns
ERR_OK if successful, another err_t otherwise

Definition at line 143 of file sys_arch.c.

References ERR_OK, mutex, ubthread_mutex_list::mutex, NULL, and ubthread_mutex_init().

Here is the call graph for this function:

◆ sys_mutex_set_invalid()

void sys_mutex_set_invalid ( sys_mutex_t mutex)

Set a mutex invalid so that sys_mutex_valid returns 0

◆ sys_mutex_unlock()

void sys_mutex_unlock ( sys_mutex_t mutex)

Unlock a mutex

Parameters
mutexthe mutex to unlock

Definition at line 156 of file sys_arch.c.

References mutex, ubthread_mutex_list::mutex, and ubthread_mutex_unlock().

Here is the call graph for this function:

◆ sys_mutex_valid()

int sys_mutex_valid ( sys_mutex_t mutex)

Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid