using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;
using System.Threading;
public class MainClass
{
private static object deadlockA = new object();
private static object deadlockB = new object();
public static void Main()
{
lock (deadlockA) {
ThreadPool.QueueUserWorkItem(delegate {
lock (deadlockB) {
Console.WriteLine("A");
lock (deadlockA) {
Console.WriteLine("B");
}
}
});
lock (deadlockB) {
Console.WriteLine("Main: got b");
}
}
}
}
|