Your code sample has some errors. This is a fixed version, where the return value of the call to bind
is used as the sole parameter in the boost::thread
constructor:
boost::thread consumer_thread(boost::bind(foo, ob));
But you can skip the call to boost::bind
entirely, passing the function and its parameters to the constructor:
boost::thread consumer_thread(foo, ob);