c++ , pthread and static callbacks. “this” returns a pointer to the base class inctead of the derived one (part 2)
问题 this thread was started here but due to lack of an altogether good example (and in order to avoid delete all that question) it is re-written here. So, in the following example, the void cppthread::ThreadedFunc() gets spawned to execute as a separate thread . Instead I would prefer void ThreadedWrite::ThreadedFunc() to be executed. How can I do that? (some more details follow after the code) cppthread.hpp #ifndef CPPTHREAD_HPP #define CPPTHREAD_HPP #include <pthread.h> using namespace std;