distortos  v0.6.0
object-oriented C++ RTOS for microcontrollers
distortos::internal::RunnableThread Class Referenceabstract

RunnableThread class defines additional interface functions required for the thread to be actually runnable. More...

#include "RunnableThread.hpp"

Inheritance diagram for distortos::internal::RunnableThread:
[legend]
Collaboration diagram for distortos::internal::RunnableThread:
[legend]

Protected Member Functions

virtual void exit0Hook ()=0
 Thread's "exit 0" hook function. More...
 
virtual void exit1Hook ()=0
 Thread's "exit 1" hook function. More...
 
virtual void run ()=0
 Thread's "run" function. More...
 

Friends

void threadExiter (RunnableThread &)
 Thread "exiter" function. More...
 
void threadRunner (RunnableThread &)
 Thread runner function - entry point of threads. More...
 

Additional Inherited Members

- Public Member Functions inherited from distortos::Thread
virtual ~Thread ()=0
 Thread's destructor. More...
 
virtual int detach ()=0
 Detaches the thread. More...
 
virtual int generateSignal (uint8_t signalNumber)=0
 Generates signal for thread. More...
 
virtual uint8_t getEffectivePriority () const =0
 
virtual ThreadIdentifier getIdentifier () const =0
 
virtual SignalSet getPendingSignalSet () const =0
 Gets set of currently pending signals. More...
 
virtual uint8_t getPriority () const =0
 
virtual SchedulingPolicy getSchedulingPolicy () const =0
 
virtual size_t getStackHighWaterMark () const =0
 
virtual size_t getStackSize () const =0
 
virtual ThreadState getState () const =0
 
virtual int join ()=0
 Waits for thread termination. More...
 
virtual int queueSignal (uint8_t signalNumber, sigval value)=0
 Queues signal for thread. More...
 
virtual void setPriority (uint8_t priority, bool alwaysBehind={})=0
 Changes priority of thread. More...
 
virtual void setSchedulingPolicy (SchedulingPolicy schedulingPolicy)=0
 

Detailed Description

RunnableThread class defines additional interface functions required for the thread to be actually runnable.

Member Function Documentation

◆ exit0Hook()

virtual void distortos::internal::RunnableThread::exit0Hook ( )
protectedpure virtual

Thread's "exit 0" hook function.

This hook will be called early during thread's exit - while the thread is still runnable.

Implemented in distortos::internal::ThreadCommon, and distortos::internal::DynamicThreadBase.

Here is the caller graph for this function:

◆ exit1Hook()

virtual void distortos::internal::RunnableThread::exit1Hook ( )
protectedpure virtual

Thread's "exit 1" hook function.

This hook will be called late during thread's exit - after the thread is removed from the scheduler.

Implemented in distortos::internal::ThreadCommon, and distortos::internal::DynamicThreadBase.

Here is the caller graph for this function:

◆ run()

virtual void distortos::internal::RunnableThread::run ( )
protectedpure virtual

Thread's "run" function.

Implemented in distortos::internal::DynamicThreadBase, distortos::internal::anonymous_namespace{MainThread.cpp}::MainThread, distortos::internal::StaticThreadBase< StackSize, Function, Args >, and distortos::internal::StaticThreadBase< StackSize, Function, Args... >.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ threadExiter

void threadExiter ( RunnableThread runnableThread)
friend

Thread "exiter" function.

Performs following actions:

  • thread's "exit 0" hook is executed;
  • thread is terminated and removed from scheduler;
  • thread's "exit 1" hook is executed;
  • context switch is forced;

This function never returns.

Parameters
[in]runnableThreadis a reference to RunnableThread object that is being exited

◆ threadRunner

void threadRunner ( RunnableThread runnableThread)
friend

Thread runner function - entry point of threads.

Performs following actions:

  • executes thread's "run" function;
  • calls thread "exiter" function;

This function never returns.

Parameters
[in]runnableThreadis a reference to RunnableThread object that is being run

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