stoppable endless tests on linux, 2nd attempt

This commit is contained in:
peter
2011-05-23 15:31:42 +02:00
parent 12c7dbccf9
commit 118f6a93fe
@@ -130,19 +130,19 @@ public class ShutDownTracker implements Runnable {
return list.isEmpty()? null : list.removeLast();
}
public static void invokeAndWait(boolean timed, Runnable runnable) {
public static void invokeAndWait(boolean timed, final Runnable runnable) {
if (timed) {
final Semaphore semaphore = new Semaphore();
semaphore.down();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
runnable.run();
semaphore.up();
}
});
if (!semaphore.waitFor(1000)) {
return;
}
semaphore.waitFor(1000);
return;
}
try {