The ThisThread namespace allows controlling the current thread. More...
Functions | |
| uint32_t | flags_clear (uint32_t flags) |
| Clears the specified Thread Flags of the currently running thread. More... | |
| uint32_t | flags_get () |
| Returns the Thread Flags currently set for the currently running thread. More... | |
| uint32_t | flags_wait_all (uint32_t flags, bool clear=true) |
| Wait for all of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_any (uint32_t flags, bool clear=true) |
| Wait for any of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_all_for (uint32_t flags, uint32_t millisec, bool clear=true) |
| Wait for all of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_all_for (uint32_t flags, Kernel::Clock::duration_u32 rel_time, bool clear=true) |
| Wait for all of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_all_until (uint32_t flags, uint64_t millisec, bool clear=true) |
| Wait for all of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_all_until (uint32_t flags, Kernel::Clock::time_point abs_time, bool clear=true) |
| Wait for all of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_any_for (uint32_t flags, uint32_t millisec, bool clear=true) |
| Wait for any of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_any_for (uint32_t flags, Kernel::Clock::duration_u32 rel_time, bool clear=true) |
| Wait for any of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_any_until (uint32_t flags, uint64_t millisec, bool clear=true) |
| Wait for any of the specified Thread Flags to become signaled for the current thread. More... | |
| uint32_t | flags_wait_any_until (uint32_t flags, Kernel::Clock::time_point abs_time, bool clear=true) |
| Wait for any of the specified Thread Flags to become signaled for the current thread. More... | |
| void | sleep_for (uint32_t millisec) |
| Sleep for a specified time period in millisec: More... | |
| void | sleep_for (Kernel::Clock::duration_u32 rel_time) |
| Sleep for a specified time period: More... | |
| void | sleep_until (uint64_t millisec) |
| Sleep until a specified time in millisec The specified time is according to Kernel::get_ms_count(). More... | |
| void | sleep_until (Kernel::Clock::time_point abs_time) |
| Sleep until a specified time in millisec The specified time is according to Kernel::Clock. More... | |
| void | yield () |
| Pass control to next equal-priority thread that is in state READY. More... | |
| osThreadId_t | get_id () |
| Get the thread id of the current running thread. More... | |
| const char * | get_name () |
| Get the thread name of the current running thread. More... | |
The ThisThread namespace allows controlling the current thread.
Example:
| uint32_t rtos::ThisThread::flags_clear | ( | uint32_t | flags | ) |
Clears the specified Thread Flags of the currently running thread.
| flags | specifies the flags of the thread that should be cleared. |
| uint32_t rtos::ThisThread::flags_get | ( | ) |
Returns the Thread Flags currently set for the currently running thread.
| uint32_t rtos::ThisThread::flags_wait_all | ( | uint32_t | flags, |
| bool | clear = true |
||
| ) |
Wait for all of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
| uint32_t rtos::ThisThread::flags_wait_all_for | ( | uint32_t | flags, |
| uint32_t | millisec, | ||
| bool | clear = true |
||
| ) |
Wait for all of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| millisec | timeout value. |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
5s rather than 5000. | uint32_t rtos::ThisThread::flags_wait_all_for | ( | uint32_t | flags, |
| Kernel::Clock::duration_u32 | rel_time, | ||
| bool | clear = true |
||
| ) |
Wait for all of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| rel_time | timeout value. |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
| uint32_t rtos::ThisThread::flags_wait_all_until | ( | uint32_t | flags, |
| uint64_t | millisec, | ||
| bool | clear = true |
||
| ) |
Wait for all of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| millisec | absolute timeout time, referenced to Kernel::get_ms_count() |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
Kernel::Clock::now() + 5s rather than Kernel::get_ms_count() + 5000. | uint32_t rtos::ThisThread::flags_wait_all_until | ( | uint32_t | flags, |
| Kernel::Clock::time_point | abs_time, | ||
| bool | clear = true |
||
| ) |
Wait for all of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| abs_time | absolute timeout time, referenced to Kernel::Clock |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
| uint32_t rtos::ThisThread::flags_wait_any | ( | uint32_t | flags, |
| bool | clear = true |
||
| ) |
Wait for any of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
| uint32_t rtos::ThisThread::flags_wait_any_for | ( | uint32_t | flags, |
| uint32_t | millisec, | ||
| bool | clear = true |
||
| ) |
Wait for any of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| millisec | timeout value. |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
5s rather than 5000. | uint32_t rtos::ThisThread::flags_wait_any_for | ( | uint32_t | flags, |
| Kernel::Clock::duration_u32 | rel_time, | ||
| bool | clear = true |
||
| ) |
Wait for any of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| rel_time | timeout value. |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
| uint32_t rtos::ThisThread::flags_wait_any_until | ( | uint32_t | flags, |
| uint64_t | millisec, | ||
| bool | clear = true |
||
| ) |
Wait for any of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| millisec | absolute timeout time, referenced to Kernel::get_ms_count() |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
Kernel::Clock::now() + 5s rather than Kernel::get_ms_count() + 5000. | uint32_t rtos::ThisThread::flags_wait_any_until | ( | uint32_t | flags, |
| Kernel::Clock::time_point | abs_time, | ||
| bool | clear = true |
||
| ) |
Wait for any of the specified Thread Flags to become signaled for the current thread.
| flags | specifies the flags to wait for |
| abs_time | absolute timeout time, referenced to Kernel::Clock |
| clear | whether to clear the specified flags after waiting for them. (default: true) |
| osThreadId_t rtos::ThisThread::get_id | ( | ) |
Get the thread id of the current running thread.
| const char* rtos::ThisThread::get_name | ( | ) |
Get the thread name of the current running thread.
| void rtos::ThisThread::sleep_for | ( | uint32_t | millisec | ) |
Sleep for a specified time period in millisec:
| millisec | time delay value |
5s rather than 5000. | void rtos::ThisThread::sleep_for | ( | Kernel::Clock::duration_u32 | rel_time | ) |
Sleep for a specified time period:
| rel_time | time delay value |
| void rtos::ThisThread::sleep_until | ( | uint64_t | millisec | ) |
Sleep until a specified time in millisec The specified time is according to Kernel::get_ms_count().
| millisec | absolute time in millisec |
Kernel::Clock::now() + 5s rather than Kernel::get_ms_count() + 5000. | void rtos::ThisThread::sleep_until | ( | Kernel::Clock::time_point | abs_time | ) |
Sleep until a specified time in millisec The specified time is according to Kernel::Clock.
| abs_time | absolute time |
| void rtos::ThisThread::yield | ( | ) |
Pass control to next equal-priority thread that is in state READY.
(Higher-priority READY threads would prevent us from running; this will not enable lower-priority threads to run, as we remain READY).