Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem with boost:thread
From: Daniel Veneros (dann.vd_at_[hidden])
Date: 2010-03-04 12:26:32


True.
I added a useless cin just to see what happens and as the program is still
"alive" I get to see the thread.
Do you know how can I avoid the main thread to end before my thread is
executed?
Thanks!!

Dann

On Thu, Mar 4, 2010 at 1:17 PM, Igor R <boost.lists_at_[hidden]> wrote:

> > Trash myTrash("hello");
> > myTrash.start();
>
> At this point your main thread *ends* and the program ends, so the 2nd
> thread doesn't have an opportunity to do anything. That's why you need
> to wait for the 2nd thread -- by means of join().
> _______________________________________________
> 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