1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 23:55:26 +02:00

[fix] Synchronize waitAndDispatch implementations

This commit is contained in:
Uwe Stieber 2008-02-15 12:18:35 +00:00
parent 782dfcd8ea
commit 50ded2aa5f

View file

@ -108,12 +108,12 @@ public final class RSEWaitAndDispatchUtil {
boolean isTimedOut= false;
if (timeout >= 0 && condition != null) {
long start = System.currentTimeMillis();
Display display = Display.findDisplay(Thread.currentThread());
final Display display = Display.findDisplay(Thread.currentThread());
if (display != null) {
// ok, we are running within a display thread --> keep the
// display event dispatching running.
long current = System.currentTimeMillis();
while (timeout == 0 || (current - start) < timeout) {
while (timeout == 0 || (current - start) < timeout && !display.isDisposed()) {
if (condition.isTrue()) break;
if (!display.readAndDispatch()) display.sleep();
current = System.currentTimeMillis();