Пример #1
0
 public static void Main(string[] args)
 {
     var demo = new DeadlockDemo();
     demo.Test();
     Console.WriteLine("No deadlock!");
 }
Пример #2
0
 protected override void OnStartup(StartupEventArgs e)
 {
     DeadlockDemo demo = new DeadlockDemo();
     demo.Test();
     Console.WriteLine("This will not be reached!"); // Deadlock here as UI thread is locked by t.Wait(); call
 }