Change this to std::vector<boost::shared_ptr<boost::thread>> threads;