I#ve got some kind of an issue here. I'm using pthread (POSIX), which is a c library and therefore not able to handle memberfunctions. I wrote a little work-around which static_cast's my memberfunction like so:
If I uncomment the return statement it gives me an error returning something in a void* function...
Now it works but gives me a warning to not return something in a *void function...
If you make it return void, you can no longer pass it to pthread_create.
But you're first calling updateStats on the casted obj pointer, then trying to call updateStats again on an apparently non-existant "myObj". And trying to return whatever updateStats returns. Does it even return a pointer?
Besides, you should use Boost.Thread or another C++ library. As you already stated, pthread is a C library.
And another puzzler:
(I don't have the time to rewrite my proggy right now, I need to get my masters theses done! But I'll look into Boost next time...)
If I declare the function void, not return anything and call "&launchUpdateStats" within pthread, it should be fine?! (might be a coward's way, but should work yes?)