[threads] Fix mono_thread_info_sleep overflow
commit089c47f1c07bf250d76c36e04675569fc6f5b4ba
authorLudovic Henry <ludovic@xamarin.com>
Mon, 29 Feb 2016 14:42:31 +0000 (29 14:42 +0000)
committerLudovic Henry <ludovic@xamarin.com>
Tue, 1 Mar 2016 11:03:50 +0000 (1 11:03 +0000)
treedb6d049884410369e7463b07cdbe47059401730c
parentef8ee284908087068fb9425d79117015ca0d4c8f
[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.
mono/utils/mono-threads.c