129 #if TN_MUTEX_DEADLOCK_DETECT
291 #endif // _TN_MUTEX_H
TN_MutexProtocol
Mutex protocol for avoid priority inversion.
enum TN_RCode tn_mutex_create(struct TN_Mutex *mutex, enum TN_MutexProtocol protocol, int ceil_priority)
Construct the mutex.
Circular doubly linked list, for internal kernel usage.
TN_RCode
Result code returned by kernel services.
enum TN_RCode tn_mutex_lock_polling(struct TN_Mutex *mutex)
The same as tn_mutex_lock() with zero timeout.
enum TN_RCode tn_mutex_unlock(struct TN_Mutex *mutex)
Unlock mutex.
TN_ObjId
Magic number for object validity verification.
unsigned long TN_TickCnt
Type for system tick count, it is used by the kernel to represent absolute tick count value as well a...
Definitions used through the whole kernel.
enum TN_MutexProtocol protocol
Mutex protocol: priority ceiling or priority inheritance.
struct TN_ListItem deadlock_list
List of other mutexes involved in deadlock (normally, this list is empty)
enum TN_RCode tn_mutex_delete(struct TN_Mutex *mutex)
Destruct mutex.
struct TN_ListItem mutex_queue
To include in task's locked mutexes list (if any)
enum TN_RCode tn_mutex_lock(struct TN_Mutex *mutex, TN_TickCnt timeout)
Lock mutex.
int cnt
Lock count (for recursive locking)
enum TN_ObjId id_mutex
id for object validity verification
int ceil_priority
Used if only protocol is TN_MUTEX_PROT_CEILING: maximum priority of task that may lock the mutex...
Mutex uses priority ceiling protocol.
Mutex uses priority inheritance protocol.
Circular doubly linked list item, for internal kernel usage.
struct TN_Task * holder
Current mutex owner (task that locked mutex)
struct TN_ListItem wait_queue
List of tasks that wait a mutex.