|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
Free functions that operate on the currently running thread. More...
Functions | |
| void | sleep_ms (uint32_t ms) noexcept |
Suspend the calling thread for at least ms milliseconds. Plain-millisecond analog of std::this_thread::sleep_for. | |
| template<typename Rep , typename Period > | |
| void | sleep_for (std::chrono::duration< Rep, Period > d) noexcept |
Suspend the calling thread for the given chrono duration. std::this_thread::sleep_for analog. | |
| void | yield () noexcept |
Voluntarily relinquish the CPU to another ready thread of equal or higher priority. std::this_thread::yield analog. | |
| ove_thread_t | self () noexcept |
| thread_id | get_id () noexcept |
Free functions that operate on the currently running thread.
Mirrors std::this_thread::. Use these for sleep, yield, and self-identification from inside a thread entry function. Previously these lived as static members on Thread<> (e.g. Thread<>::sleep_ms(500)), which read as "an operation on a
thread" when semantically it's "the current thread."
|
inlinenoexcept |
Suspend the calling thread for at least ms milliseconds. Plain-millisecond analog of std::this_thread::sleep_for.
| [in] | ms | Sleep duration in milliseconds. Pass 0 to yield for one scheduler tick. |
|
inlinenoexcept |
Suspend the calling thread for the given chrono duration. std::this_thread::sleep_for analog.
| Rep | Underlying arithmetic type of d. |
| Period | Tick period of d. |
| [in] | d | Sleep duration; rounded down to whole milliseconds (the substrate's resolution). |
|
inlinenoexcept |