I have the below simple program using boost threads, what would be the changes needed to do the same in c++0X
#include<iostream>
#include<boost/thread/thread.hpp>
boost::mutex mutex;
struct count
{
count(int i): id(i){}
void operator()()
{
boost::mutex::scoped_lock lk(mutex);
for(int i = 0 ; i < 10000 ; i++)
{
std::cout<<"Thread "<<id<<"has been called "<<i<<" Times"<<std::endl;
}
}
private:
int id;
};
int main()
{
boost::thread thr1(count(1));
boost::thread thr2(count(2));
boost::thread thr3(count(3));
thr1.join();
thr2.join();
thr3.join();
return 0;
}