distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
distortos::internal::anonymous_namespace{MainThread.cpp}::MainThread Class Reference

MainThread class is a Thread for main() More...

Inheritance diagram for distortos::internal::anonymous_namespace{MainThread.cpp}::MainThread:
[legend]
Collaboration diagram for distortos::internal::anonymous_namespace{MainThread.cpp}::MainThread:
[legend]

Public Member Functions

 MainThread (const uint8_t priority, ThreadGroupControlBlock &threadGroupControlBlock, SignalsReceiver *const signalsReceiver)
 MainThread's constructor. 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 ThreadCommonoperator= (const ThreadCommon &)=delete
 
ThreadCommonoperator= (ThreadCommon &&)=delete
 
- Public Member Functions inherited from distortos::Thread
virtual ~Thread ()=default
 Thread's destructor. More...
 

Static Public Member Functions

static void lowLevelInitializer ()
 Low-level initializer of main() thread and scheduler. 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...
 
ThreadControlBlockgetThreadControlBlock ()
 
const ThreadControlBlockgetThreadControlBlock () const
 
int startInternal ()
 Starts the thread. More...
 

Additional Inherited Members

- Public Types inherited from distortos::internal::ThreadCommon
using StackStorageUniquePointer = Stack::StorageUniquePointer
 unique_ptr (with deleter) to storage for stack More...
 

Detailed Description

MainThread class is a Thread for main()

Constructor & Destructor Documentation

◆ MainThread()

distortos::internal::anonymous_namespace{MainThread.cpp}::MainThread::MainThread ( const uint8_t  priority,
ThreadGroupControlBlock threadGroupControlBlock,
SignalsReceiver *const  signalsReceiver 
)
inline

MainThread's constructor.

Parameters
[in]priorityis the thread's priority, 0 - lowest, UINT8_MAX - highest
[in]threadGroupControlBlockis a reference to ThreadGroupControlBlock to which this object will be added
[in]signalsReceiveris a pointer to SignalsReceiver object for main thread, nullptr to disable reception of signals for main thread
Here is the call graph for this function:

Member Function Documentation

◆ lowLevelInitializer()

void distortos::internal::anonymous_namespace{MainThread.cpp}::MainThread::lowLevelInitializer ( )
static

Low-level initializer of main() thread and scheduler.

This function is called before constructors for global and static objects via BIND_LOW_LEVEL_INITIALIZER().

◆ run()

void distortos::internal::anonymous_namespace{MainThread.cpp}::MainThread::run ( )
inlineoverrideprotectedvirtual

Thread's "run" function.

Warning
This function must not be used!

Implements distortos::internal::RunnableThread.


The documentation for this class was generated from the following file: