org.jclarion.clarion.test.WaitRunnable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clarion-runtime Show documentation
Show all versions of clarion-runtime Show documentation
JClarion runtime environment
The newest version!
package org.jclarion.clarion.test;
public abstract class WaitRunnable implements Runnable
{
private boolean done;
private Object result;
@Override
public final void run()
{
result = doRun();
synchronized(this) {
done=true;
notifyAll();
}
}
public Object getResult()
{
synchronized(this) {
while (!done) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
return result;
}
public abstract Object doRun();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy