Hi all,
I am new to threads in c++, and I must use the pthread library. The documentation is easy to understand, but there is a more general aspect that I am missing. My question is: Is it possible to give a pointer to an object's function as argument to pthread_create()?
I tried, without success, something like this:
struct Obj{
int i;
Obj( int n ): i(n){}
void* myfun(void* ptr){}
}
Obj o(6);
pthread_create( handler, NULL, &(o.myfun), NULL);
Thank you