QP/C++  7.0.1
Real-Time Embedded Framework
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"

Go to the source code of this file.


namespace  QP
 namespace associated with the QP/C++ framework


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


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

Detailed Description

Last updated on: 2022-05-13
Last updated for: Version 7.0.1, 2022-05-14

Definition in file qxk_xthr.cpp.

Macro Definition Documentation


#define QXTHREAD_CAST_ (   ptr_)    (static_cast<QP::QXThread *>(ptr_))
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 64 of file qxk_xthr.cpp.

Function Documentation

◆ QXK_threadRet_()

void QXK_threadRet_ ( void  )
Called when the extended-thread handler function returns.
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.
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 655 of file qxk_xthr.cpp.