[Mono-dev] System.Threading Bug in Mono 1.1.10 ( Regression )
Zoltan Varga
vargaz at gmail.com
Tue Dec 20 02:25:13 EST 2005
Hi,
This isn't a regression. Thread.Interrupt never worked in mono,
however, in older versions,
it did nothing, causing code using it to silently fail, now it throws
a NotImplementedException.
http://bugzilla.ximian.com/show_bug.cgi?id=74525
Zoltan
On 12/20/05, Victor Romero <vromero at ipn.mx> wrote:
> 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
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
More information about the Mono-devel-list
mailing list