Embedded Artistry Framework
Embedded Systems C++ Framework
Functions
embvm::this_thread Namespace Reference

Functions that operate on the currently active thread. More...

Functions

void sleep_for (const embvm::os_timeout_t &delay) noexcept
 Sleep the currently running thread for a set amount of time The thread will sleep for at least the specified time, but may sleep longer depending on the scheduler. More...
 
void yield () noexcept
 Yields execution of the current thread so other threads can run. More...
 
embvm::thread::handle_t get_handle () noexcept
 Get the native handle for the currently active thread. More...
 

Detailed Description

Functions that operate on the currently active thread.

These static functions must be implemented for each OS so the linker has an active definition. If the function is not supported, you should call assert() or abort().

Function Documentation

◆ get_handle()

embvm::thread::handle_t embvm::this_thread::get_handle ( )
noexcept

Get the native handle for the currently active thread.

If custom extensions or behaviors are needed, the thread handle can be retrieved and manipulated directly.

Returns
the native thread object handle as a void*. The user must cast appropriately.

Referenced by os::freertos::ConditionVariable::freertos_wait().

◆ sleep_for()

void embvm::this_thread::sleep_for ( const embvm::os_timeout_t delay)
noexcept

Sleep the currently running thread for a set amount of time The thread will sleep for at least the specified time, but may sleep longer depending on the scheduler.

Parameters
delayThe number of milliseconds to sleep the thread for

References os::freertos::Thread::delay_for(), and os::freertos::frameworkTimeoutToTicks().

Referenced by nRF52DK_FrameworkDemoPlatform::led_blink_thread_(), main(), embvm::i2c::activeMaster< 128 >::process_(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::process_(), embdrv::SimulatorSystemClock::spin(), and embdrv::SimulatorTimer::~SimulatorTimer().

◆ yield()

void embvm::this_thread::yield ( )
noexcept

Yields execution of the current thread so other threads can run.

References os::freertos::Thread::delay_for().