16 Mar
2007
16 Mar
'07
2:50 a.m.
On 16/03/07, Meryl Silverburgh
Hi,
If I create a boost::thread like this:
boost::thread thrd1(&reader);
1. how can I sleep inside the thread? (in the method 'reader')
I don't know of any portable way to sleep/pause the function. One (perhaps unhelpful) option could be std::cin.get()? This would pause the thread until you hit the keyboard, although I'm unsure if any locking issues arise here (I don't _think_ they would). 2. when does the thread 'thrd1' terminate? thrd1 terminates when reader() returns. hth, Darren