|
ADTF
|
#include <kernel_thread.h>
Inherited by adtf::system::kernel_thread_looper.
Public Member Functions | |
| kernel_thread () | |
| kernel_thread (const kernel_thread &)=delete | |
| kernel_thread (kernel_thread &&) | |
| template<typename Callable, typename ... Args> | |
| kernel_thread (const adtf::services::IKernel::tSchedulingInfo &sScheduling, const char *strName, Callable &&pFunc, Args &&... args) | |
| template<typename Callable, typename ... Args> | |
| kernel_thread (const char *strName, Callable &&pFunc, Args &&... args) | |
| ~kernel_thread () | |
| kernel_thread & | operator= (kernel_thread &&oOther) |
| void | Swap (kernel_thread &oOther) |
| bool | Joinable () const |
| tResult | Join (tTimeStamp nTimeout=-1) |
| tResult | Detach () |
| tResult | SetScheduling (const adtf::services::IKernel::tSchedulingInfo &sScheduling) |
| tResult | GetScheduling (adtf::services::IKernel::tSchedulingInfo &sScheduling) const |
| bool | IsCurrentThread () const |
Friends | |
| class | cKernelThreadHelperRunnable |
Class that manages a kernel thread. This can be use as a drop-in replacement for std::thread In contrast to std::thread, the destructor will join the thread if neccessary.
| adtf::system::kernel_thread::kernel_thread | ( | ) |
Default constructor. Joinable = false.
| adtf::system::kernel_thread::kernel_thread | ( | kernel_thread && | ) |
Move constructor
|
inline |
Constructor that allows the definition of scheduling parameters.
|
inline |
Constructor that creates a new thread.
| adtf::system::kernel_thread::~kernel_thread | ( | ) |
Destructor.
| tResult adtf::system::kernel_thread::Detach | ( | ) |
Detaches from the underlying kernel thread. All resources will be freed once the thread finishes.
| ERR_INVALID_STATE | Thread is not joinable. |
| tResult adtf::system::kernel_thread::GetScheduling | ( | adtf::services::IKernel::tSchedulingInfo & | sScheduling | ) | const |
Retrieves the scheduling parameters of the thread.
| [in] | sScheduling | The scheduling parameters. |
| bool adtf::system::kernel_thread::IsCurrentThread | ( | ) | const |
Check if the executing thread is managed by this thread object.
| tResult adtf::system::kernel_thread::Join | ( | tTimeStamp | nTimeout = -1 | ) |
Join the thread
| [in] | nTimeout | Defines how long this call will block before returning (microseconds, -1 = infinite) |
| ERR_INVALID_STATE | Thread is not joinable. |
| ERR_TIMEOUT | The timeout has expired. |
| bool adtf::system::kernel_thread::Joinable | ( | ) | const |
Whether or not the thread is joinable.
| kernel_thread & adtf::system::kernel_thread::operator= | ( | kernel_thread && | oOther | ) |
Move assignment operator.
| [in,out] | oOther | The object that should be moved. |
| tResult adtf::system::kernel_thread::SetScheduling | ( | const adtf::services::IKernel::tSchedulingInfo & | sScheduling | ) |
Changes the scheduling parameters of the thread.
| [in] | sScheduling | The new scheduling parameters. |
| void adtf::system::kernel_thread::Swap | ( | kernel_thread & | oOther | ) |
Swaps two threads
| [in,out] | oOther | The second thread. |