In the following example code it appears that the thread that's made in the static constructor only ever gets run after the static constructor finishes executing. In this case that results in the static constructor never finishing because of the wait.
What's going on here?
using System;
using System.Threading;
static public class Test
{
static public bool isDone = false;
static Test()
{
Thread a = new Thread(TestThread);
a.Priority = ThreadPriority.Highest;
a.Start();
while (!isDone)
Thread.Sleep(1);
Console.WriteLine(isDone);
}
static private void TestThread()
{
isDone = true;
}
}