16 Mar
2007
16 Mar
'07
3:49 a.m.
On 3/15/07, Meryl Silverburgh
boost::thread thrd1(&reader);
1. how can I sleep inside the thread? (in the method 'reader')
how about boost::thread::sleep? http://boost.org/doc/html/thread.html#id2449425-bb Note that xtime is an absolute time, not a delta, so you'll need to get current and add 5 before passing it to that.
2. when does the thread 'thrd1' terminate?
When it's done. If the thread that started it might finish before thrd1, then you'll probably want to thrd1.join() at some point. ~ Scott McMurray