pthread_create() and class member functions....

From: KOSU_FOKIN@garbo.lucas.lu.se
Date: Thu Sep 30 1999 - 19:31:21 MEST


Hello rooters!

I am trying to play around C++ implementation of posix threads and I realise
that I can't pass a class member function into pthread_create() which takes an
address of a function (void*) as the third argument. It says  

"builder.cxx", line 122: Error: Formal argument 3 of type void*(*)(void*) 
in call to pthread_create(unsigned*, const _pthread_attr*, void*(*)(void*), void*) 
is being passed void*(TVME::*)(void*).


Could someone tell me how to solve the problem?

It also says on the web in Linux FAQ

F.2: I'm trying to use LinuxThreads from a C++ program, and the compiler complains about the third argument to pthread_create() !
You're probably trying to pass a class member function or some other C++ thing as third 
argument to pthread_create(). Recall that pthread_create() is a C function, and it must be 
passed a C function as third argument.


But that's rather strange ...

I suppose that ROOT OO thread wrapper does this job. How?

Best regards,
Anton



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:40 MET