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.
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_Timeout
The value representing maximum number of system ticks to wait.
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.
enum TN_RCode tn_mutex_lock(struct TN_Mutex *mutex, TN_Timeout timeout)
Lock mutex.
struct TN_ListItem mutex_queue
To include in task's locked mutexes list (if any)
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.
struct TN_Task * holder
Current mutex owner (task that locked mutex)
struct TN_ListItem wait_queue
List of tasks that wait a mutex.