Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » asyncExec() - what's wrong?
asyncExec() - what's wrong? [message #146028] Fri, 17 October 2003 15:56
Eclipse UserFriend
Hi,

If I understand correctly, the Display#asyncExec() should be the SWT
alternative to swing's invokeLater() method (that is - take a Runnable,
and execute it in the UI thread when all other tasks are done).

What I see is the following behavior - all events occur in the same
thread (main thread)
1. The user saves a file.
2. Various builders run
2.1. Java builder runs
2.2. My builder runs and invokes Display#asyncExec(runnable)
My builder finishes
2.3. Before the build manager exits, my runnable is being run - which
is wrong - it should wait until all builders finish. my runnable
class tries to invoke a builder and of course fails.

I am confused - the Display#readAndDispatch() method appears to be
reentrant.

Please tell me what I'm doing wrong or whether this is a bug (I use
WSAD5.1 trial).

Thanks,
Genady

Here is the full stack trace:
Thread [main] (Suspended)
BuildManager.canRun(int) line: 295
BuildManager.build(IProject, int, String, Map, IProgressMonitor) line: 278
Project.build(int, String, Map, IProgressMonitor) line: 64
RMIBuilder$1.run(IProgressMonitor) line: 258
ModalContext.runInCurrentThread(IRunnableWithProgress,
IProgressMonitor) line: 302
ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor,
Display) line: 252
ApplicationWindow$1.run() line: 431
BusyIndicator.showWhile(Display, Runnable) line: 69
WorkbenchWindow(ApplicationWindow).run(boolean, boolean,
IRunnableWithProgress) line: 428
WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line: 1385
RMIBuilder$2.run() line: 270
RunnableLock.run() line: 35
UISynchronizer(Synchronizer).runAsyncMessages() line: 98
Display.runAsyncMessages() line: 1815
Display.readAndDispatch() line: 1549
EventLoopProgressMonitor.runEventLoop() line: 94
EventLoopProgressMonitor.isCanceled() line: 73
SubProgressMonitor(ProgressMonitorWrapper).isCanceled() line: 87
SubProgressMonitor(ProgressMonitorWrapper).isCanceled() line: 87
Policy.checkCanceled(IProgressMonitor) line: 146
BuildManager.basicBuild(IProject, int, ICommand[], MultiStatus,
IProgressMonitor) line: 192
BuildManager$1.run() line: 151
InternalPlatform.run(ISafeRunnable) line: 1006
Platform.run(ISafeRunnable) line: 413
BuildManager.basicBuild(IProject, int, MultiStatus, IProgressMonitor)
line: 165
BuildManager.basicBuildLoop(IProject[], IProject[], int, MultiStatus,
IProgressMonitor) line: 243
BuildManager.build(int, IProgressMonitor) line: 212
Workspace.endOperation(boolean, IProgressMonitor) line: 884
Workspace.run(IWorkspaceRunnable, IProgressMonitor) line: 1600
EditorManager$10.run(IProgressMonitor) line: 1039
EditorManager$8.run(IProgressMonitor) line: 960
ModalContext.runInCurrentThread(IRunnableWithProgress,
IProgressMonitor) line: 302
ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor,
Display) line: 252
ApplicationWindow$1.run() line: 431
BusyIndicator.showWhile(Display, Runnable) line: 69
WorkbenchWindow(ApplicationWindow).run(boolean, boolean,
IRunnableWithProgress) line: 428
WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line: 1385
EditorManager.runProgressMonitorOperation(String,
IRunnableWithProgress, IWorkbenchWindow) line: 966
EditorManager.saveAll(List, boolean, IWorkbenchWindow) line: 1053
EditorManager.saveAll(boolean, boolean) line: 992
WorkbenchPage.saveAllEditors(boolean) line: 2346
SaveAllAction.run() line: 101
SaveAllAction(Action).runWithEvent(Event) line: 842
ActionContributionItem.handleWidgetSelection(Event) line: 456
ActionContributionItem.handleWidgetEvent(Event) line: 403
ActionContributionItem.access$0(ActionContributionItem, Event) line: 397
ActionContributionItem$ActionListener.handleEvent(Event) line: 72
EventTable.sendEvent(Event) line: 81
MenuItem(Widget).sendEvent(Event) line: 840
Display.runDeferredEvents() line: 1838
Display.readAndDispatch() line: 1545
Workbench.runEventLoop(Window$IExceptionHandler) line: 1402
Workbench.run(Object) line: 1385
InternalBootLoader.run(String, URL, String, String[], Runnable) line: 858
BootLoader.run(String, URL, String, String[], Runnable) line: 461
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 [local
variables unavailable]
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 [local
variables unavailable]
Method.invoke(Object, Object[]) line: 324 [local variables unavailable]
Main.basicRun(String[]) line: 291
Main.run(String[]) line: 747
Main.main(String[]) line: 583
Previous Topic:Getting actions for adding/removing breakpoints etc.
Next Topic:Help on how to hook a RetargetAction to a running Action or Action Delegate
Goto Forum:
  


Current Time: Wed Apr 16 04:10:14 EDT 2025

Powered by FUDForum. Page generated in 0.02293 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top