From the boost::thread documentation it seems that I can pass parameters to the thread function by doing this:
boost::thread* myThread = new boost::thread(callbackFunc, param);
However, when I do this the compiler complains that
no overloaded function takes 2 arguments
My code:
#include <boost/thread/thread.hpp>
void Game::playSound(sf::Sound* s) {
boost::thread soundThread(playSoundTask, s);
soundThread.join();
}
void Game::playSoundTask(sf::Sound* s) {
// do things
}
I am using the copy of boost that came with Ogre3d, which I suppose could be very old. Interestingly, though, I took a look at thread.hpp and it does have the templates for constructors with 2 or more parameters.