Lightweight mutex library.
More...
#include <ppu-types.h>
Go to the source code of this file.
Lightweight mutex library.
Definition in file mutex.h.
◆ SYS_LWMUTEX_ATTR_NOT_RECURSIVE
| #define SYS_LWMUTEX_ATTR_NOT_RECURSIVE 0x0020 |
Lightweight mutex is not recursive.
Definition at line 23 of file mutex.h.
◆ SYS_LWMUTEX_ATTR_PROTOCOL
| #define SYS_LWMUTEX_ATTR_PROTOCOL 0x0002 |
◆ SYS_LWMUTEX_ATTR_RECURSIVE [1/2]
| #define SYS_LWMUTEX_ATTR_RECURSIVE 0x0010 |
Lightweight mutex is recursive.
Definition at line 11 of file mutex.h.
◆ SYS_LWMUTEX_ATTR_RECURSIVE [2/2]
| #define SYS_LWMUTEX_ATTR_RECURSIVE 0x0010 |
Lightweight mutex is recursive.
Definition at line 11 of file mutex.h.
◆ SYS_LWMUTEX_PROTOCOL_FIFO
| #define SYS_LWMUTEX_PROTOCOL_FIFO 1 |
FIFO lightweight mutex scheduling policy.
Definition at line 14 of file mutex.h.
◆ SYS_LWMUTEX_PROTOCOL_PRIO
| #define SYS_LWMUTEX_PROTOCOL_PRIO 2 |
Priority-based lightweight mutex scheduling policy.
Definition at line 16 of file mutex.h.
◆ SYS_LWMUTEX_PROTOCOL_PRIO_INHERIT
| #define SYS_LWMUTEX_PROTOCOL_PRIO_INHERIT 3 |
Priority-based lightweight mutex scheduling policy with inheritance.
Definition at line 18 of file mutex.h.
◆ sys_lwmutex_attr_t
Lightweight mutex attributes data structure.
◆ sys_lwmutex_t
Lightweight mutex data structure.
◆ sysLwMutexCreate()
Create a lightweight mutex.
- Parameters
-
| mutex | Pointer to the lightweight mutex structure to be initialized. |
| attr | Pointer to the lightweight mutex attributes. |
- Returns
- zero if no error occured, nonzero otherwise.
◆ sysLwMutexDestroy()
Destroy a lightweight mutex.
- Parameters
-
| mutex | Pointer to the lightweight mutex structure. |
- Returns
- zero if no error occured, nonzero otherwise.
◆ sysLwMutexLock()
Lock a lightweight mutex.
- Parameters
-
| mutex | Pointer to the lightweight mutex structure. |
| timeout_usec | Timeout value in microseconds, or 0 if no timeout is used. |
- Returns
- zero if the lightweight mutex was successfully locked, nonzero in case of error or if a timeout occured.
◆ sysLwMutexTryLock()
Try to lock a lightweight mutex (non-blocking).
- Parameters
-
| mutex | Pointer to the lightweight mutex structure. |
- Returns
- zero if the lightweight mutex was successfully locked, nonzero in case of error or if the lightweight mutex is already locked by another thread.
◆ sysLwMutexUnlock()
Unlock a previously locked lightweight mutex.
- Parameters
-
| mutex | Pointer to the lightweight mutex structure. |
- Returns
- zero if no error occured, nonzero otherwise.