3fa Subj : How to pass class-member function to pthread_create(....)? To : comp.programming.threads From : Huskier Date : Fri Jul 15 2005 01:47 am Hi all: I want to pass a class-member function to pthread_create, and my code is in the following, but I don't know how to pass myobj.thread_function to pthread_create function. class test { public: test(){} ~test(){} void thread_function(void*){} }; int main() { test myobj; pthread_t thrd; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /**************************************************************/ pthread_create(&thrd, &attr, /*????????*/, NULL); /**************************************************************/ pthread_attr_destroy(&attr); } pthread_create(...)'s Syntax #include ; int pthread_create (pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg) ; . 0