00001 public class Deadlock 00002 { 00003 static int state; 00004 static Lock lock2; 00005 static Lock lock1; 00006 00007 public static void main (java.lang.String[] args) 00008 { 00009 lock1 = new Lock(); 00010 lock2 = new Lock(); 00011 Process1 p1 = new Process1(); 00012 Process2 p2 = new Process2(); 00013 p1.start(); 00014 p2.start(); 00015 } 00016 }