Boost logo

Boost :

Subject: Re: [boost] [thread] Can boost::this_thread::sleep_for() totally stop the thread?
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-09-03 06:05:19


Diving into the code, I just realize the real source of the problem:

 struct BOOST_SYMBOL_VISIBLE timeout
        {
            win32::ticks_type start;
            uintmax_t milliseconds; // HERE
            bool relative;
            boost::system_time abs_time;

            static unsigned long const max_non_infinite_wait=0xfffffffe;

            timeout(uintmax_t milliseconds_): // HERE

do_wait() takses a timeout which will use a unsined int as milliseconds,
which will make any negative number very big.
Assuming ceil() returns a negative number (I might have made a mistake in
my precedent mail), then we get a very big timeout....

I'm not sure how to fix this other than adding checks into wait_until and
wait_for....


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk