distortos
v0.7.0
object-oriented C++ RTOS for microcontrollers
|
StaticThreadBase class is a templated common base for StaticThread. More...
#include "distortos/StaticThread.hpp"
Public Types | |
using | Base = UndetachableThread |
base of StaticThreadBase More... | |
Public Types inherited from distortos::internal::ThreadCommon | |
using | StackStorageUniquePointer = Stack::StorageUniquePointer |
unique_ptr (with deleter) to storage for stack More... | |
Public Member Functions | |
StaticThreadBase (const uint8_t priority, const SchedulingPolicy schedulingPolicy, SignalsReceiver *const signalsReceiver, Function &&function, Args &&... args) | |
StaticThreadBase's constructor. More... | |
StaticThreadBase (const StaticThreadBase &)=delete | |
StaticThreadBase (StaticThreadBase &&)=default | |
const StaticThreadBase & | operator= (const StaticThreadBase &)=delete |
StaticThreadBase & | operator= (StaticThreadBase &&)=delete |
int | start () |
Starts the thread. More... | |
Public Member Functions inherited from distortos::UndetachableThread | |
int | detach () override |
Detaches the thread. More... | |
Public Member Functions inherited from distortos::internal::ThreadCommon | |
ThreadCommon (Stack &&stack, uint8_t priority, SchedulingPolicy schedulingPolicy, ThreadGroupControlBlock *threadGroupControlBlock, SignalsReceiver *signalsReceiver) | |
ThreadCommon's constructor. More... | |
~ThreadCommon () override | |
ThreadCommon's destructor. More... | |
int | generateSignal (uint8_t signalNumber) override |
Generates signal for thread. More... | |
uint8_t | getEffectivePriority () const override |
ThreadIdentifier | getIdentifier () const override |
SignalSet | getPendingSignalSet () const override |
Gets set of currently pending signals. More... | |
uint8_t | getPriority () const override |
SchedulingPolicy | getSchedulingPolicy () const override |
size_t | getStackHighWaterMark () const override |
size_t | getStackSize () const override |
ThreadState | getState () const override |
int | join () override |
Waits for thread termination. More... | |
int | queueSignal (uint8_t signalNumber, sigval value) override |
Queues signal for thread. More... | |
void | setPriority (uint8_t priority, bool alwaysBehind={}) override |
Changes priority of thread. More... | |
void | setSchedulingPolicy (SchedulingPolicy schedulingPolicy) override |
ThreadCommon (const ThreadCommon &)=delete | |
ThreadCommon (ThreadCommon &&)=default | |
const ThreadCommon & | operator= (const ThreadCommon &)=delete |
ThreadCommon & | operator= (ThreadCommon &&)=delete |
Public Member Functions inherited from distortos::Thread | |
virtual | ~Thread ()=default |
Thread's destructor. More... | |
Protected Member Functions | |
void | run () override |
Thread's "run" function. More... | |
Protected Member Functions inherited from distortos::internal::ThreadCommon | |
void | exit0Hook () override |
Thread's "exit 0" hook function. More... | |
void | exit1Hook () override |
Thread's "exit 1" hook function. More... | |
ThreadControlBlock & | getThreadControlBlock () |
const ThreadControlBlock & | getThreadControlBlock () const |
int | startInternal () |
Starts the thread. More... | |
Private Attributes | |
std::aligned_storage< adjustedStackSize+internal::stackGuardSize >::type | stack_ |
stack buffer More... | |
decltype(std::bind(std::declval< Function >(), std::declval< Args >()...)) | boundFunction_ |
bound function object More... | |
Static Private Attributes | |
static constexpr size_t | adjustedStackSize |
size of stack adjusted to alignment requirements, bytes More... | |
StaticThreadBase class is a templated common base for StaticThread.
StackSize | is the size of stack, bytes |
Function | is the function that will be executed in separate thread |
Args | are the arguments for Function |
using distortos::internal::StaticThreadBase< StackSize, Function, Args >::Base = UndetachableThread |
base of StaticThreadBase
|
inline |
StaticThreadBase's constructor.
[in] | priority | is the thread's priority, 0 - lowest, UINT8_MAX - highest |
[in] | schedulingPolicy | is the scheduling policy of the thread |
[in] | signalsReceiver | is a pointer to SignalsReceiver object for this thread, nullptr to disable reception of signals for this thread |
[in] | function | is a function that will be executed in separate thread |
[in] | args | are arguments for function |
|
inlineoverrideprotectedvirtual |
Thread's "run" function.
Executes bound function object.
Implements distortos::internal::RunnableThread.
|
inline |
Starts the thread.
This operation can be performed on threads in "created" state only.
|
staticprivate |
size of stack adjusted to alignment requirements, bytes
|
private |
bound function object
|
private |
stack buffer