ReactOS 0.4.16-dev-297-gc569aee
|
Mutexes are recommended to correctly handle priority inversion, especially if you use LWIP_CORE_LOCKING .
void sys_mutex_free | ( | sys_mutex_t * | mutex | ) |
Deallocates a mutex.
mutex | the mutex to delete |
Definition at line 157 of file sys_arch.c.
void sys_mutex_lock | ( | sys_mutex_t * | mutex | ) |
Blocks the thread until the mutex can be grabbed.
mutex | the mutex to lock |
Definition at line 173 of file sys_arch.c.
Referenced by mem_malloc().
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. The mutex is allocated to the memory that 'mutex' points to (which can be both a pointer or the actual OS structure). If the mutex has been created, ERR_OK should be returned. Returning any other error will provide a hint what went wrong, but except for assertions, no real error handling is implemented.
mutex | pointer to the mutex to create |
Definition at line 149 of file sys_arch.c.
Referenced by mem_init(), and tcpip_init().
void sys_mutex_set_invalid | ( | sys_mutex_t * | mutex | ) |
Invalidate a mutex so that sys_mutex_valid() returns 0. ATTENTION: This does NOT mean that the mutex shall be deallocated: sys_mutex_free() is always called before calling this function! This may also be a define, in which case the function is not prototyped.
Definition at line 166 of file sys_arch.c.
void sys_mutex_unlock | ( | sys_mutex_t * | mutex | ) |
Releases the mutex previously locked through 'sys_mutex_lock()'.
mutex | the mutex to unlock |
Definition at line 185 of file sys_arch.c.
Referenced by mem_malloc().
int sys_mutex_valid | ( | sys_mutex_t * | mutex | ) |
Returns 1 if the mutes is valid, 0 if it is not valid. When using pointers, a simple way is to check the pointer for != NULL. When directly using OS structures, implementing this may be more complex. This may also be a define, in which case the function is not prototyped.