FileDocCategorySizeDatePackage
Chopstick.javaAPI DocExample575Tue Dec 12 18:57:46 GMT 2000None

Chopstick

public class Chopstick extends Object

Fields Summary
Thread
holder
Constructors Summary
Methods Summary
public synchronized voidgrab()


          
        while (holder != null)
            wait();
        holder = Thread.currentThread();
    
public synchronized voidrelease()

        holder = null;
        notify();
    
public synchronized voidreleaseIfMine()

        if (holder == Thread.currentThread())
            holder = null;
        notify();