Subj : Re: How to pass class-member function to pthread_create(....)? To : comp.programming.threads From : Torsten Robitzki Date : Mon Jul 18 2005 09:13 pm Vyacheslav Kononenko wrote: > > Chris Thomasson wrote: > >>>>Unfortunately extern "C" is necessary if your interested in creating >>>>"correct code"... >>> >>>The problem is using extern "C" does _NOT_ make 100% correct code >>>either. It could be safer to do that. But could be safer is different >>>than correct/incorrect statements showed here. >> >>I would argue that it is "correct" to use extern "C" for the functions you >>pass to a pthreads library; pthreads is a C library after all... > > > extern "C" does not gurantee that your C++ function would be correctly > callable from any C code. So what's the point of declaring a function extern "C" other then make it callable from C? > So I do not agree with statement that says: > "static member solution is incorrect when extern "C" function is". It > could be safer that's all. It might work. But why would one gamble and depend on something that might work if there is an easy approach that is required to work because there are specifications that guaranties that this approach will work? regards Torsten .