25 Jul
2012
25 Jul
'12
11:14 p.m.
On Mon, Jul 23, 2012 at 5:57 PM, Serg Gulko
For some reason this functionality not works for me.
Change this function:
//Simple thread function void Test::worker(int delay) { try { boost::this_thread::sleep_for(boost::chrono::milliseconds(delay)); cout << "Doing some work" << endl; } catch (boost::thread_interrupted const& e) { cout << "INTERRUPTED" << endl; } }
To this: void Test::worker(int delay) { try { while (true) { boost::this_thread::sleep_for(boost::chrono::milliseconds(delay)); cout << "Doing some work" << endl; } } catch (boost::thread_interrupted const& e) { cout << "INTERRUPTED" << endl; } }