|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
Interfaces and components for building a virtual OS. More...
|
Namespaces | |
| embvm::cv | |
| Condition Variable types and definitions. | |
| embvm::tls | |
| Thread Local Storage types. | |
| embvm::once | |
| embvm::eventflag | |
| Event flag types and definitions. | |
| embvm::mutex | |
| Mutex types and definitions. | |
| embvm::semaphore | |
| Semaphore types and definitions. | |
| embvm::thread | |
| Thread types and definitions. | |
| embvm::msgqueue | |
| Message queue types and definitions. | |
| embvm::this_thread | |
| Functions that operate on the currently active thread. | |
Classes | |
| class | embvm::VirtualConditionVariable |
| Defines the VirtualConditionVariable interface. More... | |
| class | embvm::VirtualEventFlag |
| Defines the VirtualEventFlag interface. More... | |
| class | embvm::VirtualHeap< THeapImpl > |
| class | embvm::VirtualMutex |
| Defines the VirtualMutex interface. More... | |
| class | embvm::VirtualOSFactory< TFactory > |
| Factory interface for creating RTOS-related objects. More... | |
| class | embvm::VirtualSemaphore |
| Defines the VirtualSemaphore interface. More... | |
| class | embvm::VirtualThread |
| Defines the VirtualThread interface. More... | |
Typedefs | |
| using | embvm::os_timeout_t = std::chrono::duration< uint64_t, std::nano > |
| Timeout type used for OS-related functions. More... | |
Variables | |
| constexpr os_timeout_t | embvm::OS_WAIT_FOREVER = os_timeout_t{UINT64_C(-1)} |
| Create a WAIT_FOREVER alias which can be used. More... | |
Interfaces and components for building a virtual OS.
| class embvm::VirtualConditionVariable |
Defines the VirtualConditionVariable interface.
VirtualConditionVariable defines the common condition variable interfaces for a VirtualRTOS. RTOS implementations should derive from this base class.
The factory is responsible for creating the cv, so the constructor is not defined in this interface class.

Public Member Functions | |
| VirtualConditionVariable (const VirtualConditionVariable &)=delete | |
| Delete the copy constructor. More... | |
| const VirtualConditionVariable & | operator= (const VirtualConditionVariable &)=delete |
| Delete the copy assignment operator. More... | |
| VirtualConditionVariable (VirtualConditionVariable &&)=default | |
| Default move constructor. More... | |
| VirtualConditionVariable & | operator= (VirtualConditionVariable &&)=default |
| Default move operator. More... | |
| virtual bool | wait (embvm::VirtualMutex *mutex) noexcept=0 |
| Blocks the current thread until the condition variable is woken up or after the specified timeout duration. More... | |
| virtual bool | wait (embvm::VirtualMutex *mutex, const embvm::os_timeout_t &timeout) noexcept=0 |
| bool | wait (embvm::VirtualMutex *mutex, const embvm::cv::func_t &predicate) noexcept |
| bool | wait (embvm::VirtualMutex *mutex, const embvm::cv::func_t &predicate, const embvm::os_timeout_t &timeout=embvm::OS_WAIT_FOREVER) noexcept |
| virtual void | signal () noexcept=0 |
| notifies one waiting thread More... | |
| void | notify_one () noexcept |
| Alias for signal so we can work with STL types. More... | |
| virtual void | broadcast () noexcept=0 |
| Notify all waiting threads. More... | |
| void | notify_all () noexcept |
| Alias for broadcast so we can work with STL types. More... | |
| virtual embvm::cv::handle_t | native_handle () const noexcept=0 |
Protected Member Functions | |
| VirtualConditionVariable ()=default | |
| virtual | ~VirtualConditionVariable () noexcept |
| Derived classes should ensure their destructor deletes the OS CV. More... | |
|
delete |
Delete the copy constructor.
|
default |
Default move constructor.
|
protecteddefault |
|
protectedvirtualdefaultnoexcept |
Derived classes should ensure their destructor deletes the OS CV.
|
pure virtualnoexcept |
Notify all waiting threads.
Implemented in os::posix::ConditionVariable, and os::freertos::ConditionVariable.
Referenced by notify_all().
|
pure virtualnoexcept |
Implemented in os::posix::ConditionVariable, and os::freertos::ConditionVariable.
|
inlinenoexcept |
Alias for broadcast so we can work with STL types.
References broadcast().
|
inlinenoexcept |
Alias for signal so we can work with STL types.
References signal().
|
delete |
Delete the copy assignment operator.
|
default |
Default move operator.
|
pure virtualnoexcept |
notifies one waiting thread
Implemented in os::posix::ConditionVariable, and os::freertos::ConditionVariable.
Referenced by notify_one().
|
pure virtualnoexcept |
Blocks the current thread until the condition variable is woken up or after the specified timeout duration.
Implemented in os::freertos::ConditionVariable, and os::posix::ConditionVariable.
Referenced by wait().
|
pure virtualnoexcept |
Implemented in os::freertos::ConditionVariable, and os::posix::ConditionVariable.
|
inlinenoexcept |
References wait().
|
inlinenoexcept |
We break when the predicate is true or when we've timed out
References wait().
| class embvm::VirtualEventFlag |
Defines the VirtualEventFlag interface.
VirtualEventFlag defines the common event flag interfaces for a VirtualRTOS. RTOS implementations should derive from this base class.
The factory is responsible for creating the event flag, so the constructor is not defined in this interface class.

Public Member Functions | |
| virtual embvm::eventflag::flag_t | get (embvm::eventflag::flag_t bits_wait, embvm::eventflag::option opt=embvm::eventflag::option::OR, bool clearOnExit=true, const embvm::os_timeout_t &timeout=embvm::OS_WAIT_FOREVER) noexcept=0 |
| Get (or wait for) event flags. More... | |
| virtual void | set (embvm::eventflag::flag_t bits) noexcept=0 |
| Set event flags. More... | |
| virtual void | setFromISR (embvm::eventflag::flag_t bits) noexcept=0 |
| Set event flags from an ISR. More... | |
| virtual void | clear () noexcept=0 |
| Clear all event flag bits. More... | |
| virtual embvm::eventflag::handle_t | native_handle () const noexcept=0 |
| Get the native handle for the event flags group object. More... | |
| VirtualEventFlag (const VirtualEventFlag &)=delete | |
| Delete the copy constructor. More... | |
| const VirtualEventFlag & | operator= (const VirtualEventFlag &)=delete |
| Delete the copy assignment operator. More... | |
| VirtualEventFlag (VirtualEventFlag &&)=default | |
| Default move constructor. More... | |
| VirtualEventFlag & | operator= (VirtualEventFlag &&)=default |
| Default move assignment operator. More... | |
Protected Member Functions | |
| VirtualEventFlag ()=default | |
| virtual | ~VirtualEventFlag () noexcept |
| Derived classes should ensure their destructor deletes the OS event flag. More... | |
|
delete |
Delete the copy constructor.
|
default |
Default move constructor.
|
protecteddefault |
|
protectedvirtualdefaultnoexcept |
Derived classes should ensure their destructor deletes the OS event flag.
|
pure virtualnoexcept |
Clear all event flag bits.
Implemented in os::posix::EventFlag, and os::freertos::EventFlag.
|
pure virtualnoexcept |
Get (or wait for) event flags.
Get the event flag bits. If the required event flags are not set, this function will block the calling thread until the flags are set or the timeout expires.
To see all bits currently set, set bits_wait to ~0 and timeout_t to the minimal value (timeout_t(1)).
| bits_wait | A bitmask of bits to wait for in the event flags group. |
| opt | The wait option, which is combined with bits_wait to control the behavior of get(). embvm::eventflag::option::OR will return once any of the bits specified in bits_wait are set in the event flag group. embvm::eventflag::option::AND will only return once ALL of the bits specified in bits_wait are set in the event flag group. |
| clearOnExit | If true, all event flags that were specified in bits_wait and set in the event flag group will be set to 0. If false, event flag bits will not be modified. |
| timeout | Specify a timeout for the get operation. If OS_WAIT_FOREVER is supplied, this call will block until the event flags are set. Otherwise, the function will timeout after the elapsed time if flags are not set. |
Implemented in os::posix::EventFlag, and os::freertos::EventFlag.
Referenced by embutil::InterruptQueue< std::mutex >::wait_and_pop().
|
pure virtualnoexcept |
Get the native handle for the event flags group object.
Implemented in os::posix::EventFlag, and os::freertos::EventFlag.
|
delete |
Delete the copy assignment operator.
|
default |
Default move assignment operator.
|
pure virtualnoexcept |
Set event flags.
Set event flags from a threaded context. Threads waiting on event flags (via get()) will be notified.
| bits | A bitmask representing the bits to set in the event flag group. |
Implemented in os::posix::EventFlag, and os::freertos::EventFlag.
Referenced by embutil::InterruptQueue< std::mutex >::~InterruptQueue().
|
pure virtualnoexcept |
Set event flags from an ISR.
Set event flags from an interrupt context. This call must not use a lock. Threads waiting on event flags (via get()) will be notified.
| bits | A bitmask representing the bits to set in the event flag group. |
Implemented in os::posix::EventFlag, and os::freertos::EventFlag.
Referenced by embutil::InterruptQueue< std::mutex >::dispatch().
| class embvm::VirtualHeap |
Static Public Member Functions | |
| static void | addBlock (void *addr, size_t size) noexcept |
| static void | init () noexcept |
| static void * | alloc (size_t size) noexcept |
| static void | free (void *addr) noexcept |
|
inlinestaticnoexcept |
References assert.
Referenced by malloc_addblock().
|
inlinestaticnoexcept |
Referenced by malloc().
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
Referenced by __attribute__().
| class embvm::VirtualMessageQueue |
Defines the VirtualMessageQueue interface.
VirtualMessageQueue defines the common message queue interfaces for a VirtualRTOS. RTOS implementations should derive from this base class. This class is templated, because message queues can hold any type of data structure.
The factory is responsible for creating the message queue, so the constructor is not defined in this interface class.
| TType | The type of data to be stored in the message queue. |

Public Member Functions | |
| VirtualMessageQueue (const VirtualMessageQueue &)=delete | |
| Deleted copy constructor. More... | |
| const VirtualMessageQueue & | operator= (const VirtualMessageQueue &)=delete |
| Deleted copy assignment operator. More... | |
| VirtualMessageQueue (VirtualMessageQueue &&) noexcept=default | |
| Default move constructor. More... | |
| VirtualMessageQueue & | operator= (VirtualMessageQueue &&) noexcept=default |
| Default move assignment operator. More... | |
| virtual bool | push (TType val, embvm::os_timeout_t timeout=embvm::OS_WAIT_FOREVER) noexcept=0 |
| Post a message to the queue. More... | |
| virtual std::optional< TType > | pop (embvm::os_timeout_t timeout=embvm::OS_WAIT_FOREVER) noexcept=0 |
| Retrieve a message from the queue. More... | |
| virtual size_t | size () const noexcept=0 |
| Get the current size of the message queue. More... | |
| virtual void | reset () noexcept=0 |
| Reset the message queue to an empty state. More... | |
| virtual bool | empty () const noexcept=0 |
| Check if the message queue is empty. More... | |
| virtual bool | full () const noexcept=0 |
| Check if the message queue is full. More... | |
| virtual embvm::msgqueue::handle_t | native_handle () const noexcept=0 |
| Get the native handle for the message queue object. More... | |
Protected Member Functions | |
| VirtualMessageQueue ()=default | |
| virtual | ~VirtualMessageQueue () noexcept=default |
| Derived classes should ensure their destructor deletes the OS msg queue. More... | |
|
delete |
Deleted copy constructor.
|
defaultnoexcept |
Default move constructor.
|
protecteddefault |
|
protectedvirtualdefaultnoexcept |
Derived classes should ensure their destructor deletes the OS msg queue.
|
pure virtualnoexcept |
Check if the message queue is empty.
Implemented in os::posix::MessageQueue< TType >, and os::freertos::MessageQueue< TType >.
|
pure virtualnoexcept |
Check if the message queue is full.
Implemented in os::posix::MessageQueue< TType >, and os::freertos::MessageQueue< TType >.
|
pure virtualnoexcept |
Get the native handle for the message queue object.
Implemented in os::freertos::MessageQueue< TType >.
|
delete |
Deleted copy assignment operator.
|
defaultnoexcept |
Default move assignment operator.
|
pure virtualnoexcept |
Retrieve a message from the queue.
Retrieve a message from the queue. This function blocks the calling thread until a message is received (if OS_WAIT_FOREVER is specified as a timeout), or until the timeout expires.
| timeout | The time to wait for a new message. A value of OS_WAIT_FOREVER indicates that the thread should block until a new message is posted. |
has_value() member function to determine if the value is valid. A valid value is only returned on success. Implemented in os::posix::MessageQueue< TType >, and os::freertos::MessageQueue< TType >.
|
pure virtualnoexcept |
Post a message to the queue.
Post a message to the queue. This function blocks the calling thread until there is an available slot (if OS_WAIT_FOREVER is specified as a timeout), or until the timeout expires.
Posting a message to the queue will notify all threads waiting on a new message (via pop()).
| val | The data value to post to the queue. |
| timeout | The time to wait for a new message. A value of OS_WAIT_FOREVER indicates that the thread should block until a new message is posted. |
Implemented in os::posix::MessageQueue< TType >, and os::freertos::MessageQueue< TType >.
|
pure virtualnoexcept |
Reset the message queue to an empty state.
Implemented in os::posix::MessageQueue< TType >, and os::freertos::MessageQueue< TType >.
|
pure virtualnoexcept |
Get the current size of the message queue.
Size represents the number of elements stored, rather than the maximum size (aka capacity).
Implemented in os::posix::MessageQueue< TType >, and os::freertos::MessageQueue< TType >.
| class embvm::VirtualMutex |
Defines the VirtualMutex interface.
VirtualMutex defines the common mutex interfaces for a VirtualRTOS. RTOS implementations should derive from this base class.
The factory is responsible for creating the mutex, so the constructor is not defined in this interface class.

Public Member Functions | |
| VirtualMutex (const VirtualMutex &)=delete | |
| Deleted copy constructor. More... | |
| const VirtualMutex & | operator= (const VirtualMutex &)=delete |
| Deleted copy assignment operator. More... | |
| VirtualMutex (VirtualMutex &&)=default | |
| Default move constructor. More... | |
| VirtualMutex & | operator= (VirtualMutex &&)=default |
| Default move assignment operator. More... | |
| virtual void | lock () noexcept=0 |
| Lock the mutex. More... | |
| virtual void | unlock () noexcept=0 |
| Unlock the mutex. More... | |
| virtual bool | trylock () noexcept=0 |
| Try to lock the mutex. More... | |
| virtual embvm::mutex::handle_t | native_handle () const noexcept=0 |
Protected Member Functions | |
| VirtualMutex ()=default | |
| virtual | ~VirtualMutex () noexcept |
| Derived classes should ensure their destructor deletes the OS mutex. More... | |
|
delete |
Deleted copy constructor.
|
default |
Default move constructor.
|
protecteddefault |
|
protectedvirtualdefaultnoexcept |
Derived classes should ensure their destructor deletes the OS mutex.
|
pure virtualnoexcept |
Lock the mutex.
Attempts to lock the mutex. If successful, the function returns with the calling thread owning the lock. If the lock is already owned, the calling thread will block until the lock is available.
Implemented in os::posix::Mutex, and os::freertos::Mutex.
|
pure virtualnoexcept |
Implemented in os::posix::Mutex, and os::freertos::Mutex.
|
delete |
Deleted copy assignment operator.
|
default |
Default move assignment operator.
|
pure virtualnoexcept |
Try to lock the mutex.
Try to lock the mutex, but don't block the thread if the mutex is already owned.
Implemented in os::posix::Mutex, and os::freertos::Mutex.
|
pure virtualnoexcept |
Unlock the mutex.
Implemented in os::posix::Mutex, and os::freertos::Mutex.
| class embvm::VirtualOSFactory |
Factory interface for creating RTOS-related objects.
This calls provides the virtual interface for creating RTOS objects.
We use the curiously recurring template pattern (CRTP) for this factory. To create a new factory for your OS, derive in the following way:
The derived class must implement the _impl() versions of the functions defined here.
| TFactory | Derived factory class which implements the functions as required by the target RTOS. |
Public Member Functions | |
| VirtualOSFactory ()=default | |
| ~VirtualOSFactory ()=default | |
Static Public Member Functions | |
| static embvm::VirtualConditionVariable * | createConditionVariable () noexcept |
| Create a virtual condition variable. More... | |
| static embvm::VirtualThread * | createThread (std::string_view name, embvm::thread::func_t f, embvm::thread::input_t input=nullptr, embvm::thread::priority p=embvm::thread::priority::normal, size_t stack_size=DEFAULT_STACK_SIZE, void *stack_ptr=nullptr) noexcept |
| Create a virtual thread. More... | |
| static embvm::VirtualMutex * | createMutex (embvm::mutex::type type=embvm::mutex::type::defaultType, embvm::mutex::mode mode=embvm::mutex::mode::defaultMode) noexcept |
| Create a virtual Mutex. More... | |
| static embvm::VirtualSemaphore * | createBinarySemaphore () noexcept |
| Create a virtual binary semaphore. More... | |
| static embvm::VirtualSemaphore * | createSemaphore (embvm::semaphore::count_t ceiling, embvm::semaphore::count_t initial_count=-1) noexcept |
| Create a virtual counting semaphore. More... | |
| template<typename TType > | |
| static embvm::VirtualMessageQueue< TType > * | createMessageQueue (size_t queue_length) noexcept |
| Create a virtual message queue. More... | |
| static embvm::VirtualEventFlag * | createEventFlag () noexcept |
| Create a virtual event flag. More... | |
| static void | destroy (embvm::VirtualThread *item) noexcept |
| static void | destroy (embvm::VirtualMutex *item) noexcept |
| static void | destroy (embvm::VirtualSemaphore *item) noexcept |
| static void | destroy (embvm::VirtualEventFlag *item) noexcept |
| static void | destroy (embvm::VirtualConditionVariable *item) noexcept |
Public Attributes | |
| friend | TFactory |
|
default |
|
default |
|
inlinestaticnoexcept |
Create a virtual binary semaphore.
Creates a virtual binary semaphore using the underlying RTOS. A generic embvm::VirtualSemaphore pointer is returned, masking the underlying implementation from higher layers.
A binary semaphore is limited to a count of 1.
The caller owns the returnd pointer. It must be returned with the factory destroy() function.
References embvm::semaphore::binary.
|
inlinestaticnoexcept |
Create a virtual condition variable.
Creates a condition variable using the underlying platform RTOS. A generic embvm::VirtualConditionVariable pointer is returned, masking the underlying implementation from higher layers.
The caller owns the returnd pointer. It must be returned with the factory destroy() function.
|
inlinestaticnoexcept |
Create a virtual event flag.
Creates a virtual event flag using the underlying RTOS. A generic embvm::VirtualEventFlag pointer is returned, masking the underlying implementation from higher layers.
The caller owns the returnd pointer. It must be returned with the factory destroy() function.
Referenced by embutil::InterruptQueue< std::mutex >::InterruptQueue().
|
inlinestaticnoexcept |
Create a virtual message queue.
Creates a virtual message queue using the underlying RTOS. The type of data stored in the message queue is determined using a template parameter. A generic embvm::VirtualMessageQueue pointer is returned, masking the underlying implementation from higher layers.
The caller owns the returnd pointer. It must be returned with the factory destroy() function.
| TType | The type of the underlying data to be stored. |
| queue_length | The maximum number of elements to store in the queue. |
|
inlinestaticnoexcept |
Create a virtual Mutex.
Creates a virtual mutex using the underlying RTOS. A generic embvm::VirtualMutex pointer is returned, masking the underlying implementation from higher layers.
The caller owns the returnd pointer. It must be returned with the factory destroy() function.
| type | The type of mutex to create. |
| mode | The mutex's operational mode. |
References type.
|
inlinestaticnoexcept |
Create a virtual counting semaphore.
Creates a virtual counting semaphore using the underlying RTOS. A generic embvm::VirtualSemaphore pointer is returned, masking the underlying implementation from higher layers.
The counting semaphore supports counts > 1.
The caller owns the returnd pointer. It must be returned with the factory destroy() function.
| ceiling | The maximum count the semaphore supports. |
| initial_count | Sets the initial count of the semaphore variable. Initial-count enables support for starting the semaphore with resources in use. Negative value indicates default setting - match ceiling |
References embvm::semaphore::counting.
|
inlinestaticnoexcept |
Create a virtual thread.
Creates a thread using the underlying platform RTOS. A generic embvm::VirtualThread pointer is returned, masking the underlying implementation from higher layers.
The caller owns the returnd pointer. It must be returned with the factory destroy() function.
| name | The name of the thread. |
| f | The thread function which will be invoked. f must not be a nullptr. |
| input | Optional input value; nullptr can be specified for unused input. |
| p | Priority for the thread. |
| stack_size | the size of the thread's stack. |
| stack_ptr | Pointer to the thread's stack. nullptr input means dynamic memory will be used to allocate the stack. |
Referenced by nRF52DK_FrameworkDemoPlatform::initOS_(), and nRF52DK_FrameworkDemoPlatform::startBlink().
|
inlinestaticnoexcept |
Referenced by embutil::InterruptQueue< std::mutex >::~InterruptQueue().
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
| friend embvm::VirtualOSFactory< TFactory >::TFactory |
| class embvm::VirtualSemaphore |
Defines the VirtualSemaphore interface.
VirtualSemaphore defines the common semaphore interfaces for a VirtualRTOS. RTOS implementations should derive from this base class.
The factory is responsible for creating the semaphore, so the constructor is not defined in this interface class.

Public Member Functions | |
| VirtualSemaphore (const VirtualSemaphore &)=delete | |
| Delete the copy constructor. More... | |
| const VirtualSemaphore & | operator= (const VirtualSemaphore &)=delete |
| Delete the copy assignment operator. More... | |
| VirtualSemaphore (VirtualSemaphore &&)=default | |
| Default move constructor. More... | |
| VirtualSemaphore & | operator= (VirtualSemaphore &&)=default |
| Default move operator. More... | |
| virtual void | give () noexcept=0 |
| Increment count Return a resource to the semaphore, incrementing the count. More... | |
| virtual void | giveFromISR () noexcept=0 |
| Increment count from an ISR Return a resource to the semaphore, incrementing the count. More... | |
| virtual bool | take (const embvm::os_timeout_t &timeout=embvm::OS_WAIT_FOREVER) noexcept=0 |
| Decrement count Take a resource from the semaphore, decrementing the count. More... | |
| virtual embvm::semaphore::count_t | count () const noexcept=0 |
| Check the count of the semaphore. More... | |
| virtual embvm::semaphore::handle_t | native_handle () const noexcept=0 |
Protected Member Functions | |
| VirtualSemaphore ()=default | |
| virtual | ~VirtualSemaphore () noexcept |
| Derived classes should ensure their destructor deletes the OS semaphor. More... | |
|
delete |
Delete the copy constructor.
|
default |
Default move constructor.
|
protecteddefault |
|
protectedvirtualdefaultnoexcept |
Derived classes should ensure their destructor deletes the OS semaphor.
|
pure virtualnoexcept |
Check the count of the semaphore.
Implemented in os::freertos::Semaphore.
|
pure virtualnoexcept |
Increment count Return a resource to the semaphore, incrementing the count.
Implemented in os::posix::Semaphore, and os::freertos::Semaphore.
|
pure virtualnoexcept |
Increment count from an ISR Return a resource to the semaphore, incrementing the count.
This function variant is safe to call from an interrupt routine. No locking can be used inside this variant.
Implemented in os::posix::Semaphore, and os::freertos::Semaphore.
|
pure virtualnoexcept |
Implemented in os::posix::Semaphore, and os::freertos::Semaphore.
|
delete |
Delete the copy assignment operator.
|
default |
Default move operator.
|
pure virtualnoexcept |
Decrement count Take a resource from the semaphore, decrementing the count.
| timeout | The time to wait for a semaphore resource. A value of WAIT_FOREVER indicates that the thread should block until the semaphore can be acquired. |
Implemented in os::freertos::Semaphore.
| class embvm::VirtualThread |
Defines the VirtualThread interface.
VirtualThread defines the common thread interfaces for a VirtualRTOS. RTOS implementations should derive from this base class.
The factory is responsible for creating the thread, so the constructor is not defined in this interface class.

Public Member Functions | |
| VirtualThread (const VirtualThread &)=delete | |
| Deleted copy constructor. More... | |
| const VirtualThread & | operator= (const VirtualThread &)=delete |
| Deleted copy assignment operator. More... | |
| VirtualThread (VirtualThread &&)=delete | |
| Default move constructor. More... | |
| VirtualThread & | operator= (VirtualThread &&)=delete |
| Default move assignment operator. More... | |
| virtual embvm::thread::state | state () const noexcept=0 |
| Get the thread state. More... | |
| virtual void | start () noexcept=0 |
| Start the thread, if it is not auto-started. More... | |
| virtual void | terminate () noexcept=0 |
| Terminate a running thread. More... | |
| virtual std::string_view | name () const noexcept=0 |
| View the thread's name. More... | |
| virtual void | join () noexcept=0 |
| Join a running thread. More... | |
| virtual embvm::thread::handle_t | native_handle () const noexcept=0 |
| Get the native handle for the thread. More... | |
Protected Member Functions | |
| VirtualThread ()=default | |
| virtual | ~VirtualThread () noexcept |
| Derived classes should ensure their destructor deletes the OS task. More... | |
|
delete |
Deleted copy constructor.
|
delete |
Default move constructor.
|
protecteddefault |
|
protectedvirtualdefaultnoexcept |
Derived classes should ensure their destructor deletes the OS task.
|
pure virtualnoexcept |
Join a running thread.
Joins a running thread, blocking the calling thread until the joined thread completes.
Implemented in os::posix::Thread, and os::freertos::Thread.
|
pure virtualnoexcept |
View the thread's name.
Storage for the thread name is implementation defined. For example, the name may be stored in the RTOS memory, or it may require internal object storage.
Implemented in os::posix::Thread, and os::freertos::Thread.
|
pure virtualnoexcept |
Get the native handle for the thread.
If custom extensions or behaviors are needed, the thread handle can be retrieved and manipulated directly.
void*. The user must cast appropriately. Implemented in os::posix::Thread, and os::freertos::Thread.
|
delete |
Deleted copy assignment operator.
|
delete |
Default move assignment operator.
|
pure virtualnoexcept |
Start the thread, if it is not auto-started.
Implemented in os::posix::Thread, and os::freertos::Thread.
|
pure virtualnoexcept |
Get the thread state.
Implemented in os::posix::Thread, and os::freertos::Thread.
|
pure virtualnoexcept |
Terminate a running thread.
Implemented in os::posix::Thread, and os::freertos::Thread.
| using embvm::os_timeout_t = typedef std::chrono::duration<uint64_t, std::nano> |
Timeout type used for OS-related functions.
| constexpr os_timeout_t embvm::OS_WAIT_FOREVER = os_timeout_t{UINT64_C(-1)} |
Create a WAIT_FOREVER alias which can be used.
Referenced by convert_timeout(), os::freertos::frameworkTimeoutToTicks(), and os::posix::ConditionVariable::wait().
1.8.15