ThreadCommon class implements common functionality of threads.
More...
#include "distortos/internal/scheduler/ThreadCommon.hpp"
ThreadCommon class implements common functionality of threads.
◆ StackStorageUniquePointer
unique_ptr (with deleter) to storage for stack
◆ ThreadCommon()
ThreadCommon's constructor.
- Parameters
-
[in] | stack | is an rvalue reference to Stack object which will be adopted for this thread |
[in] | priority | is the thread's priority, 0 - lowest, UINT8_MAX - highest |
[in] | schedulingPolicy | is the scheduling policy of the thread |
[in] | threadGroupControlBlock | is a pointer to ThreadGroupControlBlock to which this object will be added, nullptr to inherit thread group from currently running thread |
[in] | signalsReceiver | is a pointer to SignalsReceiver object for this thread, nullptr to disable reception of signals for this thread |
◆ ~ThreadCommon()
distortos::internal::ThreadCommon::~ThreadCommon |
( |
| ) |
|
|
override |
◆ exit0Hook()
void distortos::internal::ThreadCommon::exit0Hook |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ exit1Hook()
void distortos::internal::ThreadCommon::exit1Hook |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ getEffectivePriority()
uint8_t distortos::internal::ThreadCommon::getEffectivePriority |
( |
| ) |
const |
|
overridevirtual |
◆ getIdentifier()
- Returns
- identifier of thread, default-constructed ThreadIdentifier if this object doesn't represent a valid thread of execution (e.g. after the thread is detached)
Implements distortos::Thread.
◆ getPriority()
uint8_t distortos::internal::ThreadCommon::getPriority |
( |
| ) |
const |
|
overridevirtual |
◆ getSchedulingPolicy()
SchedulingPolicy distortos::internal::ThreadCommon::getSchedulingPolicy |
( |
| ) |
const |
|
overridevirtual |
◆ getStackHighWaterMark()
size_t distortos::internal::ThreadCommon::getStackHighWaterMark |
( |
| ) |
const |
|
overridevirtual |
- Returns
- "high water mark" (max usage) of thread's stack, bytes
Implements distortos::Thread.
◆ getStackSize()
size_t distortos::internal::ThreadCommon::getStackSize |
( |
| ) |
const |
|
overridevirtual |
◆ getState()
ThreadState distortos::internal::ThreadCommon::getState |
( |
| ) |
const |
|
overridevirtual |
◆ getThreadControlBlock() [1/2]
◆ getThreadControlBlock() [2/2]
const ThreadControlBlock& distortos::internal::ThreadCommon::getThreadControlBlock |
( |
| ) |
const |
|
inlineprotected |
◆ setPriority()
void distortos::internal::ThreadCommon::setPriority |
( |
uint8_t |
priority, |
|
|
bool |
alwaysBehind = {} |
|
) |
| |
|
overridevirtual |
Changes priority of thread.
If the priority really changes, the position in the thread list is adjusted and context switch may be requested.
- Parameters
-
[in] | priority | is the new priority of thread |
[in] | alwaysBehind | selects the method of ordering when lowering the priority
- false - the thread is moved to the head of the group of threads with the new priority (default),
- true - the thread is moved to the tail of the group of threads with the new priority.
|
Implements distortos::Thread.
◆ setSchedulingPolicy()
void distortos::internal::ThreadCommon::setSchedulingPolicy |
( |
SchedulingPolicy |
schedulingPolicy | ) |
|
|
overridevirtual |
param [in] schedulingPolicy is the new scheduling policy of the thread
Implements distortos::Thread.
◆ startInternal()
int distortos::internal::ThreadCommon::startInternal |
( |
| ) |
|
|
protected |
Starts the thread.
This operation can be performed on threads in "created" state only.
- Returns
- 0 on success, error code otherwise:
◆ joinSemaphore_
Semaphore distortos::internal::ThreadCommon::joinSemaphore_ |
|
private |
◆ threadControlBlock_
The documentation for this class was generated from the following files: