dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] Thread test cases


From: Rhys Weatherley
Subject: [Pnet-developers] Thread test cases
Date: Thu, 26 Jun 2003 21:58:42 +1000
User-agent: KMail/1.4.3

It's getting pretty late here, so I haven't managed to track these down yet, 
but here are a couple of odd cases for others to look into.

First up, the following should throw an exception for a monitor that isn't 
entered, but the program exits without complaining:

--------------------------------------------
using System.Threading;

public class Test
{
    private void Lock()
    {
        Monitor.Exit(this);
    }

    public static void Main()
    {
        Test t = new Test();
        t.Lock();
    }
}
--------------------------------------------

Next, the following SEGV's on my machine, which is should throw an exception:

--------------------------------------------
using System.Threading;

public class Test
{
    private void Lock()
    {
        lock(this)
        {
            Monitor.Exit(this);
        }
    }

    public static void Main()
    {
        Test t = new Test();
        t.Lock();
    }
}
--------------------------------------------

I suspect that there is a problem with properly matching up enters and leaves 
on monitors, which is probably contributing to the JScript and WinForms 
issues.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]