3#include "libxr_def.hpp"
4#include "libxr_system.hpp"
信号量类,实现线程同步机制 Semaphore class implementing thread synchronization
void Post()
释放(增加)信号量 Releases (increments) the semaphore
void PostFromCallback(bool in_isr)
从中断回调中释放(增加)信号量 Releases (increments) the semaphore from an ISR (Interrupt Service Routine)
~Semaphore()
析构信号量对象,释放资源 Destroys the semaphore object and releases resources
libxr_semaphore_handle semaphore_handle_
信号量句柄 Semaphore handle
size_t Value()
获取当前信号量的值 Gets the current value of the semaphore
ErrorCode Wait(uint32_t timeout=UINT32_MAX)
等待(减少)信号量 Waits (decrements) the semaphore
LibXR Color Control Library / LibXR终端颜色控制库
SemaphoreHandle_t libxr_semaphore_handle
信号量句柄类型定义 Semaphore handle type definition
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值