Boost logo

Boost Users :

From: Meryl Silverburgh (silverburgh.meryl_at_[hidden])
Date: 2007-03-15 22:56:06


On 3/15/07, Darren Garvey <lists.drrngrvy_at_[hidden]> wrote:
>
>
> On 16/03/07, Meryl Silverburgh <silverburgh.meryl_at_[hidden]> wrote:
> > 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).

Thanks. I am looking for something which I can sleep the current
thread for 5 seconds.
>
> > 2. when does the thread 'thrd1' terminate?
>
> thrd1 terminates when reader() returns.
>
> hth,
> Darren
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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