pthread_t thread1; pthread_create(&thread1,NULL,.......,NULL); // Here I want to attach a thread to a member function of class
How can I pass t
You need to create a free extern "C" function as a trampoline:
extern "C"
class foo { public: void *thread_func(); }; extern "C" void *thread_func(void *arg) { return static_cast(arg)->thread_func(); } foo f; pthread_create(..., thread_func, &f);