thread


Thread Wrapper Class

This thread class is a simplified version of the thread class which now exists in C++11. Here, it is implemented to wrap the pthread_create call on QNX. Its usage is shown in main().

Motivation

QNX does not support C++14, so the STL thread library is not an option. This thread class is a minimal wrapper, which allows object oriented useage of threads.

Thread Class Wrapper for QNX

Use this thread wrapper to use threads in QNX in an object oriented way. You have to write a global function, or better, a functor, which is then passed to the constructor of the thread object. A functor is a class which implements the operator() (see main.cpp line 7). The event while-loop should be in there. You have to create an object of your functor class (see main.cpp line 17) and pass it as a constructor argument to the thread constructor (main.cpp line 19).

Leave a comment

Your email address will not be published. Required fields are marked *