FileDocCategorySizeDatePackage
CubbyHole.javaAPI DocExample609Tue Dec 12 18:57:48 GMT 2000None

CubbyHole

public class CubbyHole extends Object

Fields Summary
private int
contents
private boolean
available
Constructors Summary
Methods Summary
public synchronized intget()


        
        while (available == false) {
            try {
                wait();
            } catch (InterruptedException e) { }
        }
        available = false;
        notifyAll();
        return contents;
    
public synchronized voidput(int value)

        while (available == true) {
            try {
                wait();
            } catch (InterruptedException e) { }
        }
        contents = value;
        available = true;
        notifyAll();