[Mono-bugs] [Bug 605092] New: System.Timers.Timer.TimerComparer fails to compare arguments

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed May 12 05:18:17 EDT 2010



           Summary: System.Timers.Timer.TimerComparer fails to compare
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: aenomoto at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

This is a forwarded report from https://gist.github.com/21ab0a6c1015f96f9c19

Our System.Timers.Timer.TimerComparer (which is used by the scheduler) does not
look at instance differences and hence it may fail to compare instances.

Copying the repro from the link above:

using System;
using System.IO;
using System.Threading;
using System.Collections.Generic;

public class Test {
    private static Timer t1;
    private static Timer t2;
    private static Timer t3;
    public static void Main () {
        t1 = new Timer(Callback1, null, 0, 1000);
        t2 = new Timer(Callback2, null, 0, 1000);
        t3 = new Timer(Callback3, null, 0, 1000);

    private static void Callback1(Object o) { Console.Write('1'); }
    private static void Callback2(Object o) { Console.Write('2'); }
    private static void Callback3(Object o) { Console.Write('3'); }

ran on .net:
$ ./x.exe

ran on mono:
$ mono ./x.exe

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list