QP/C++ 6.9.3
qxk_xthr.cpp File Reference

QXK/C++ preemptive kernel extended (blocking) thread implementation. More...

#include "qf_port.hpp"
#include "qxk_pkg.hpp"
#include "qassert.h"
#include "qs_port.hpp"
#include "qs_pkg.hpp"
Include dependency graph for qxk_xthr.cpp:

Go to the source code of this file.

Namespaces

 QP
 namespace associated with the QP/C++ framework
 

Macros

#define QXTHREAD_CAST_(ptr_)   (static_cast<QP::QXThread *>(ptr_))
 intertnal macro to encapsulate casting of pointers for MISRA deviations *‍/ More...
 

Functions

void QXK_threadRet_ (void) noexcept
 called when a thread function returns More...
 

Detailed Description

QXK/C++ preemptive kernel extended (blocking) thread implementation.

Definition in file qxk_xthr.cpp.

Macro Definition Documentation

◆ QXTHREAD_CAST_

#define QXTHREAD_CAST_ (   ptr_)    (static_cast<QP::QXThread *>(ptr_))

intertnal macro to encapsulate casting of pointers for MISRA deviations *‍/

Description
This macro is specifically and exclusively used for downcasting pointers to QActive to pointers to QXThread in situations when it is known that such downcasting is correct. However, such pointer casting is not compliant with MISRA C++ Rule 5-2-7 as well as other messages (e.g., PC-Lint-Plus warning 826). Defining this specific macro for this purpose allows to selectively disable the warnings for this particular case.

Definition at line 68 of file qxk_xthr.cpp.

Function Documentation

◆ QXK_threadRet_()

void QXK_threadRet_ ( void  )
noexcept

called when a thread function returns

Description
Called when the extended-thread handler function returns.
Note
Most thread handler functions are structured as endless loops that never return. But it is also possible to structure threads as one-shot functions that perform their job and return. In that case this function peforms cleanup after the thread.
Precondition
this function must:
  • NOT be called from an ISR;
  • be called from an extended thread;
also: the thread must NOT be holding a scheduler lock.

Definition at line 618 of file qxk_xthr.cpp.