FileDocCategorySizeDatePackage
DaemonLock.javaAPI DocExample1779Thu Feb 04 16:10:38 GMT 1999None

DaemonLock

public class DaemonLock extends Object implements Runnable

Fields Summary
private int
lockCount
Constructors Summary
Methods Summary
public synchronized voidacquire()


	    
		if (lockCount++ == 0) {
			Thread t = new Thread(this);
			t.setDaemon(false);
			t.start();
		}
	
public synchronized voidrelease()

		if (--lockCount == 0) {
			notify();
		} 
	
public synchronized voidrun()

		while (lockCount != 0) {
			try {
				wait();
			} catch (InterruptedException ex) {};
		}