libxr 1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
signal.hpp
1#pragma once
2
3#include "libxr_def.hpp"
4#include "thread.hpp"
5
6namespace LibXR
7{
8
19class Signal
20{
21 public:
38 static ErrorCode Action(Thread &thread, int signal);
39
58 static ErrorCode ActionFromCallback(Thread &thread, int signal, bool in_isr);
59
74 static ErrorCode Wait(int signal, uint32_t timeout = UINT32_MAX);
75};
76
77} // namespace LibXR
信号处理类,用于线程间的信号传递和同步。 Signal handling class for inter-thread signaling and synchronization.
Definition signal.hpp:20
static ErrorCode Action(Thread &thread, int signal)
触发目标线程的信号处理操作。 Triggers a signal action on the target thread.
Definition signal.cpp:7
static ErrorCode Wait(int signal, uint32_t timeout=UINT32_MAX)
等待指定信号的到来。 Waits for the specified signal.
Definition signal.cpp:35
static ErrorCode ActionFromCallback(Thread &thread, int signal, bool in_isr)
在回调环境中触发目标线程的信号处理操作。 Triggers a signal action on the target thread from a callback environment.
Definition signal.cpp:16
线程管理类,封装 FreeRTOS 任务创建和调度 Thread management class encapsulating FreeRTOS task creation and scheduling
Definition thread.hpp:15
LibXR Color Control Library / LibXR终端颜色控制库
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值