public class SimpleDeadlock { /** * argv[0]: number of concurrently executed threads */ public static void main(String argv[]) { Semaphore resources[] = new Semaphore[2]; for (int i=0; i