public void run () {
        if (threadId == 1) {
	    try {
		lm.Lock (1, "a", LockManager.READ);
	    }
	    catch (DeadlockException e) {
	        System.out.println ("Deadlock.... ");
	    }

	    try {
	        this.sleep (4000);
	    }
	    catch (InterruptedException e) { }

	    try {
		lm.Lock (1, "a", LockManager.WRITE);
	    }
	    catch (DeadlockException e) {
	        System.out.println ("Deadlock.... ");
	    }
	    
	    lm.UnlockAll (1);
	}
	else if (threadId == 2) {
	    try {
		lm.Lock (2, "b", LockManager.READ);
	    }
	    catch (DeadlockException e) { 
	        System.out.println ("Deadlock.... ");
	    }

	    try {
	        this.sleep (1000);
	    }
	    catch (InterruptedException e) { }

	    try {
		lm.Lock (2, "a", LockManager.WRITE);
	    }
	    catch (DeadlockException e) { 
	        System.out.println ("Deadlock.... ");
	    }
	    
	    lm.UnlockAll (2);
	}
    }