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:
parent
782dfcd8ea
commit
50ded2aa5f
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue