1#ifndef _THREAD_ZEPHYR_H
2#define _THREAD_ZEPHYR_H
8#include <zephyr/kernel.h>
17 Thread(
const std::string& threadName);
28 virtual void DispatchDelegate(std::shared_ptr<dmq::DelegateMsg> msg)
override;
35 static void Process(
void* p1,
void* p2,
void* p3);
39 struct k_thread m_thread;
41 struct k_sem m_exitSem;
47 using ZephyrDeleter = void(*)(
void*);
51 std::unique_ptr<char, ZephyrDeleter> m_stackMemory{
nullptr, k_free};
52 std::unique_ptr<char, ZephyrDeleter> m_msgqBuffer{
nullptr, k_free};
54 const std::string THREAD_NAME;
57 static const size_t STACK_SIZE = 2048;
59 static const size_t MSGQ_MAX_MSGS = 20;
61 static const size_t MSG_SIZE =
sizeof(MsgPtr);
Interface for cross-thread delegate dispatching.
Cross-platform thread for any system supporting C++11 std::thread (e.g. Windows, Linux).
Definition cmsis-rtos2/Thread.h:33
std::string GetThreadName()
Definition zephyr/Thread.h:26
Thread(const std::string &threadName)
Thread(const std::string &threadName, size_t maxQueueSize=0)
Definition cmsis-rtos2/Thread.cpp:16
static k_tid_t GetCurrentThreadId()
virtual void DispatchDelegate(std::shared_ptr< dmq::DelegateMsg > msg) override
Enqueues a delegate message for execution on this thread.
Definition qt/Thread.cpp:93
A class to hold a platform-specific thread messsage that will be passed through the OS message queue.
Definition cmsis-rtos2/ThreadMsg.h:12
A base class for a delegate enabled execution thread. Implemented by application code if asynchronous...
Definition IThread.h:22