Merge pull request #2694 from ludovic-henry/fix-sleep-overflow
authormonojenkins <jo.shields+jenkins@xamarin.com>
Mon, 29 Feb 2016 22:35:35 +0000 (22:35 +0000)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Mon, 29 Feb 2016 22:35:35 +0000 (22:35 +0000)
commit4c4af589f3dfbed0ef1eff23691e69b886ecfd4e
tree978561569cafbddf1ce939b7da3a19076b7bed87
parent797c536463feb7ebf7b3aafdee518404389b726e
parent315e59dc35024c4d0714ed0b1d12fde33dec4aca
Merge pull request #2694 from ludovic-henry/fix-sleep-overflow

[threads] Fix mono_thread_info_sleep overflow

This overflow would happen of the machine was up for more than 29 days, leading to an overflow in the value returned by mono_100ms_ticks.

The simplest solution is simply to resort to mono_100ns_ticks which would only overflow after more than 29247 years. So even the platform implement this value as the time since 0000-00-00 00:00:00, we still have more than 27000 years if front of us. It's also highly unlikely that we would overflow the `end' value when adding `ms', as that would mean we are in the last 29 days of that 29247 years.

@monojenkins merge