Embedded Artistry Framework
Embedded Systems C++ Framework
Typedefs | Enumerations
embvm::thread Namespace Reference

Thread types and definitions. More...

Typedefs

using handle_t = uintptr_t
 Generic type for thread handles. More...
 
using input_t = void *
 Thread function's input data type. More...
 
using func_t = void(*)(input_t)
 Thread function prototype. More...
 

Enumerations

enum  state : uint8_t {
  state::ready = 0, state::executing, state::suspended, state::terminated,
  state::completed
}
 Thread's operational state. More...
 
enum  priority : uint8_t {
  priority::panic = 0, priority::interrupt, priority::realtime, priority::veryHigh,
  priority::high, priority::aboveNormal, priority::normal, priority::belowNormal,
  priority::low, priority::lowest, priority::idle
}
 Default priority settings. More...
 

Detailed Description

Thread types and definitions.

Typedef Documentation

◆ func_t

using embvm::thread::func_t = typedef void (*)(input_t)

Thread function prototype.

The function prototype for functions which can be passed to the thread object.

Survey results: pthread: void *(*start_routine)(void*) freertos: void (*task)(void) threadx: void (*task)(ulong) CMSIS: void*(*task)(void*)

◆ handle_t

Generic type for thread handles.

◆ input_t

using embvm::thread::input_t = typedef void*

Thread function's input data type.

Type of input argument sent to the thread function on start.

Survey results: threadx takes in a ULONG FreeRTOS, pthread use void* CMSIS settled on void*

We default to void*

Enumeration Type Documentation

◆ priority

Default priority settings.

These are default priority settings, allowing consumers to specify thread priority by a portable named value, rather than explicit numeric values. The named priority values are set to specific values within the RTOS-specific thread implementation.

This enumeration should be preferred to raw numeric values because the priority scheme changes from RTOS to RTOS. Code specifing exact priority numbers is not portable. However, if more precise priority specification is needed, do not use these types.

Enumerator
panic 

Panic handler should take priority over the system's operation.

interrupt 

Interrupt handling priority.

realtime 

Enable real-time priority, or highest system priority if real-time is not supported.

veryHigh 

Highest non-real-time priority.

high 
aboveNormal 
normal 

Standard operational priority.

belowNormal 
low 
lowest 

Lowest operational priority.

idle 

Processor is sleeping.

◆ state

Thread's operational state.

Enumerator
ready 

Thread is created, but not yet running.

executing 

Thread is running.

suspended 

The thread's execution is suspended or blocked.

terminated 

The thread has been terminated (did not complete on its own)

completed 

The thread completed operation on its own.