Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -713,13 +713,7 @@ public boolean openWindows() {
final Display display = PlatformUI.getWorkbench().getDisplay();
final boolean result[] = new boolean[1];

// spawn another init thread. For API compatibility We guarantee this method is
// called from
// the UI thread but it could take enough time to disrupt progress reporting.
// spawn a new thread to do the grunt work of this initialization and spin the
// event loop
// ourselves just like it's done in Workbench.

// Restore off the UI thread and spin the event loop here, it can take a while.
final Throwable[] error = new Throwable[1];
Thread initThread = new Thread() {
@Override
Expand Down Expand Up @@ -752,13 +746,14 @@ public void runWithException() throws Throwable {
error[0] = e;
} finally {
initDone = true;
Thread.yield();
try {
Thread.sleep(5);
} catch (InterruptedException e) {
// this is a no-op in this case.
}
display.wake();
// A wake() before the UI thread reaches Display.sleep() is lost, queued
// work is not. Plain runnables would be deferred until the workbench is up.
display.asyncExec(new StartupRunnable() {
@Override
public void runWithException() {
// nothing to do
}
});
}
}
};
Expand Down
Loading