[Mono-dev] System.Threading Bug in Mono 1.1.10 ( Regression )

Victor Romero vromero at ipn.mx
Tue Dec 20 01:02:36 EST 2005


Hi,

I have been reading the document "An ASM specification of C# threads and the
.NET memory model" by Robert F. Stärk and Egon Börger and there they have an
example about a bug in .NET 1.1, in Mono 1.9.2 it works perfectly, but now,
in Mono 1.1.10 It gives me and exception

/*The code*/
using System;
using System.Threading;

class Account {
    private decimal balance = 0.0M;

    public void Deposit() {
        lock (this) {
            try {
                Monitor.Wait(this);
            }
            finally {
                balance += 100.00M;
            }
        }
    }
    public static void Main() {
        Account a = new Account();
        Thread t = new Thread(new ThreadStart(a.Deposit));
        t.Start();
        Thread.Sleep(100);
        lock (a) {
            Console.WriteLine(a.balance); // Output: 0
            Monitor.Pulse(a);
            t.Interrupt();
            Thread.Sleep(100);
            Console.WriteLine(a.balance); // Output: 100.00 (.NET 1.1 bug)
        }
    }
}

.NET 1.1
C:\Documents and Settings\Pavilion\My Documents\SharpDevelop
Projects\Hilo\bin\Debug>Hilo.exe
0
100.00

Mono 1.1.9.2
-bash-3.00$ mono Hilo.exe
0
0

Mono 1.1.10
-bash-3.00$ mono Hilo.exe
0

Unhandled Exception: System.NotImplementedException: The requested feature
is not implemented.
in <0x00028> System.Threading.Thread:Interrupt ()
in <0x00108> Account:Main ()

I'm still working on how to run XSP under Solaris 10 in a SPARC with Mono
1.1.10 ...

Victor Romero

Messenger: vic_romero at hotmail.com
Business Web Page: http://www.dsnibble.com.mx
Personal Web Page: http://linux.ipn.mx/cms/space/VictorRomero
Blog Web Page: http://elcarteldetux.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051220/647e9dba/attachment.html 


More information about the Mono-devel-list mailing list