Boost logo

Boost Users :

Subject: Re: [Boost-users] how to make a thread sleep forever
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2010-05-06 11:13:41


Hi!
what about locking a mutex and wait on this mutex from the thread. This is
also what you call artificial deadlock, but anyway. Another possiblity to
wait on an event which never occurs. E.g.

lock the mutex from the thread and use a condition variable which is never
signaled. I am just curios: why do you need such a thread at all?

Regards,
Ovanes

On Thu, May 6, 2010 at 4:55 PM, Alex Flint <alex.flint_at_[hidden]> wrote:

> Is there an elegant way to make the current thread go to sleep forever? I
> simply want the current thread to sleep indefinitely, i.e. until a call to
> exit() or similar. Obviously I could call sleep() in a loop, or I could
> create an artificial deadlock, but I was wondering if there is a more
> elegant way?
>
> Cheers,
> Alex
>
>
> _______________________________________________
> 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