FileDocCategorySizeDatePackage
Chopstick.javaAPI DocExample378Tue Dec 12 18:57:48 GMT 2000None

Chopstick

public class Chopstick extends Object

Fields Summary
Philosopher
owner
Constructors Summary
Methods Summary
public synchronized voidgrab(Philosopher phil)

        while (owner != null)
            wait();
        owner = phil;
    
public synchronized voidrelease(Philosopher phil)


         
        if (phil == owner)
            owner = null;
        notify();