DelegateMQ
Loading...
Searching...
No Matches
Thread.h File Reference

CMSIS-RTOS2 implementation of the DelegateMQ IThread interface. More...

#include "delegate/IThread.h"
#include "cmsis_os2.h"
#include <string>
#include <memory>

Go to the source code of this file.

Classes

class  Thread
 Cross-platform thread for any system supporting C++11 std::thread (e.g. Windows, Linux). More...
 

Detailed Description

CMSIS-RTOS2 implementation of the DelegateMQ IThread interface.

See also
https://github.com/endurodave/DelegateMQ David Lafreniere, 2026.

This class provides a concrete implementation of the IThread interface using the CMSIS-RTOS2 standard API (cmsis_os2.h). It enables DelegateMQ to dispatch asynchronous delegates to a dedicated thread on any CMSIS-compliant RTOS (e.g., Keil RTX, FreeRTOS wrapped by CMSIS, Zephyr, etc.).

Key Features:

  • Task Integration: Wraps osThreadNew to establish a dedicated worker loop.
  • Queue-Based Dispatch: Uses osMessageQueue to receive and process incoming delegate messages in a thread-safe manner.
  • Priority Control: Supports runtime priority configuration via SetThreadPriority using standard osPriority_t levels.
  • Graceful Shutdown: Implements robust termination logic using semaphores to ensure the thread exits cleanly before destruction.