Boost logo

Boost Users :

From: me22 (me22.ca_at_[hidden])
Date: 2007-03-15 23:49:49


On 3/15/07, Meryl Silverburgh <silverburgh.meryl_at_[hidden]> wrote:
> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net