namespace System.Threading
{
-#if NET_2_0
[ComVisible (true)]
-#endif
public sealed class Timer : MarshalByRefObject, IDisposable
{
static Scheduler scheduler = Scheduler.Instance;
Init (callback, state, d, p);
}
-#if NET_2_0
public Timer (TimerCallback callback)
{
Init (callback, this, Timeout.Infinite, Timeout.Infinite);
}
-#endif
void Init (TimerCallback callback, object state, long dueTime, long period)
{
if (ty == null)
return 1;
long result = tx.next_run - ty.next_run;
- return result > 0 ? 1 : result < 0 ? -1 : 0;
+ if (result == 0)
+ return x == y ? 0 : -1;
+ return result > 0 ? 1 : -1;
}
}