// in Mutex.java

// javac Mutex.java
// java Mutex

public class Mutex {
    public static void main(String[] args) {
	Account acct = new Account();  // create shared object
	AcctThread thrA = new AcctThread("A", acct); // create A thread
	AcctThread thrB = new AcctThread("B", acct); // create B thread
	
	thrA.start();		// start A thread
	thrB.start();		// start B thread
	try {
	    thrA.join();		// wait for A to finish
	    thrB.join();		// wait for B to finish
	} catch (InterruptedException e) {
	    System.out.println("Join interrupted");
	}
    }
}

