Passing class member function to pthread_create
Hi,
I 'd like to pass a class member function to pthread_create which is called by another class member function of the same class.
Code:
class A{
public:
void * func1(void *parm);
void func2();
};
void A::func2(){
...
pthread_create(threads, NULL, & func1, (void *)(parm));
...
}
But gcc will give error:
Quote:
error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function.
How to fix this error? Thanks!