|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
Mutex types and definitions. More...
Typedefs | |
| using | handle_t = uintptr_t |
| Generic type for mutex handles. More... | |
Enumerations | |
| enum | type : std::uint8_t { type::normal = 0, type::recursive, type::defaultType = recursive } |
| Mutex types. More... | |
| enum | mode : std::uint8_t { mode::none = 0, mode::priorityInherit, mode::protect, mode::defaultMode } |
| Mutex operational modes. More... | |
Mutex types and definitions.
| using embvm::mutex::handle_t = typedef uintptr_t |
Generic type for mutex handles.
|
strong |
Mutex operational modes.
Mutexes can operate in various modes which affect thread scheduling. The Virtual RTOS utilizes three mode types:
The default operational mode is priority inheritance. Note that not all RTOSes may support the full range of modes. The program should fail to compile or run if an invalid mode is used.
Survey of OSes:
|
strong |
Mutex types.
Mutexes come in multiple flavors. The two variants that we utilize in the framework are "normal" mutexs and recursive mutexes.
Normal mutexes can only be locked once, even by the same thread. There is potential for a deadlock to occur if a thread holding a lock tries to lock again.
Recursive mutexes solve this deadlocking potential by allowing a mutex to be locked multiple times by the same thread. To relinquish a recursive mutex, it must be unlocked the same number of times that it was locked.
1.8.15