distortos  v0.6.0
object-oriented C++ RTOS for microcontrollers
distortos::UndetachableThread Class Reference

UndetachableThread class is a ThreadCommon that cannot be detached. More...

#include "UndetachableThread.hpp"

Inheritance diagram for distortos::UndetachableThread:
Collaboration diagram for distortos::UndetachableThread:

Public Member Functions

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 ()=0
 Thread's destructor. More...

Additional Inherited Members

- Public Types inherited from distortos::internal::ThreadCommon
using StackStorageUniquePointer = Stack::StorageUniquePointer
 unique_ptr (with deleter) to storage for stack 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...
- Protected Member Functions inherited from distortos::internal::RunnableThread
virtual void run ()=0
 Thread's "run" function. More...

Detailed Description

UndetachableThread class is a ThreadCommon that cannot be detached.

Member Function Documentation

◆ detach()

int distortos::UndetachableThread::detach ( )

Detaches the thread.

Similar to std::thread::detach() - http://en.cppreference.com/w/cpp/thread/thread/detach Similar to POSIX pthread_detach() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_detach.html

Detaches the executing thread from the Thread object, allowing execution to continue independently. All resources allocated for the thread will be deallocated when the thread terminates.

ENOTSUP - this thread cannot be detached;

Implements distortos::Thread.

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