Uzytkownik <hp******@yahoo.com> napisal w wiadomosci
news:67**************************@posting.google.c om...
Jacques Labuschagne <ja*****@clawshrimp.com> wrote in message
news:<Yo********************@news02.tsnz.net>... Jeff Schwab wrote:
hp******@yahoo.com wrote:
> Can any body send to me a missing file to my compiler Turbo C++ ver
> 3,called tv.lib
Sure, I've pasted the contents below:
Har har har. :-)
Could any body be more seriuos ?
Arnd Schroeter wrote:
I am a c++ programmer under the os linux. I am using pthreads and i am
wondering why i can only use satic methods of a class to create a
thread of it. How can i change this, because it limits my programmes
very strongly. thanks in advance..Arnd Schröter
Vamat certificates upper mail:
The non-static member functions have different signature, that's why.
And you can't change that. You have to work your way around it. One
possible workaround is like this:
struct thread
{
static void thread_func(void* p);
virtual void run() = 0;
};
void thread::thread_func(void* p) {
// iirc pthread_create needs a function that takes a void
// pointer.
thread* t = reinterpret_cast<thread*>(p);
t->run();
}
struct some_thread : thread {
void run() {
// do your stuff..
}
};
thread* thr = new some_thread();
Now pass thread::thread_func to the thread creation function as start
routine and thr as argument to start routine.
--
Ahti Legonkov