FileDocCategorySizeDatePackage
BusyFlag.javaAPI DocExample2080Thu Feb 04 16:10:36 GMT 1999None

BusyFlag

public class BusyFlag extends Object

Fields Summary
protected Thread
busyflag
protected int
busycount
Constructors Summary
Methods Summary
public synchronized voidfreeBusyFlag()

		if (getBusyFlagOwner() == Thread.currentThread()) {
			busycount--;
			if (busycount == 0) {
				busyflag = null;
				notify();
			}
		}
	
public synchronized voidgetBusyFlag()


	    
		while (tryGetBusyFlag() == false) {
			try {
				wait();
			} catch (Exception e) {}
		}
	
public synchronized java.lang.ThreadgetBusyFlagOwner()

		return busyflag;
	
public synchronized booleantryGetBusyFlag()

		if (busyflag == null) {
			busyflag = Thread.currentThread();
			busycount = 1;
			return true;
		}
		if (busyflag == Thread.currentThread()) {
			busycount++;
			return true;
		}
		return false;