Methods Summary |
---|
public synchronized void | freeBusyFlag()
if (getBusyFlagOwner() == Thread.currentThread()) {
busycount--;
if (busycount == 0) {
busyflag = null;
notify();
}
}
|
public synchronized void | getBusyFlag()
while (tryGetBusyFlag() == false) {
try {
wait();
} catch (Exception e) {}
}
|
public synchronized java.lang.Thread | getBusyFlagOwner()
return busyflag;
|
public synchronized boolean | tryGetBusyFlag()
if (busyflag == null) {
busyflag = Thread.currentThread();
busycount = 1;
return true;
}
if (busyflag == Thread.currentThread()) {
busycount++;
return true;
}
return false;
|