1
System / Providing class member function to thread?
« on: July 08, 2009, 05:29:44 pm »
I want to run a class member function in a separate thread. Is there any straightforward way of doing this? An hour of googling and trial-and-error experimenting hasn't helped me in this case. It is obviously not as easy as
I tried things like
to get the member function pointer, but it doesn't seem to work.
Code: [Select]
sf::Thread Thread(&MyObject.MyFunction);
.I tried things like
Code: [Select]
typedef void (SomeClass::*fptr)();
fptr ptrMyFunction;
ptrMyFunction = &SomeClass::MyFunction;
to get the member function pointer, but it doesn't seem to work.