Methods Summary |
---|
public synchronized void | cvBroadcast(BusyFlag sv)
// You must own the lock in order to use this method
if (sv.getBusyFlagOwner() != Thread.currentThread()) {
throw new IllegalMonitorStateException("current thread not owner");
}
notifyAll();
|
public void | cvBroadcast()
cvBroadcast(SyncVar);
|
public void | cvSignal()
cvSignal(SyncVar);
|
public synchronized void | cvSignal(BusyFlag sv)
// You must own the lock in order to use this method
if (sv.getBusyFlagOwner() != Thread.currentThread()) {
throw new IllegalMonitorStateException("current thread not owner");
}
notify();
|
public void | cvTimedWait(int millis)
cvTimedWait(SyncVar, millis);
|
public void | cvTimedWait(BusyFlag sv, int millis)
int i = 0;
InterruptedException errex = null;
synchronized (this) {
// You must own the lock in order to use this method
if (sv.getBusyFlagOwner() != Thread.currentThread()) {
throw new IllegalMonitorStateException("current thread not owner");
}
// Release the lock (Completely)
while (sv.getBusyFlagOwner() == Thread.currentThread()) {
i++;
sv.freeBusyFlag();
}
// Use wait() method
try {
if (millis == 0) {
wait();
} else {
wait(millis);
}
} catch (InterruptedException iex) {
errex = iex;
}
}
// Obtain the lock (Return to original state)
for (; i>0; i--) {
sv.getBusyFlag();
}
if (errex != null) throw errex;
return;
|
public void | cvWait()
cvTimedWait(SyncVar, 0);
|
public void | cvWait(BusyFlag sv)
cvTimedWait(sv, 0);
|