Project: Eclipse_Platform_UI
Bug 173995 [Progress] Switch progress monitoring to asyncExec
Reported: 2007-02-13 07:34:45 | Status: verified fixed

Create some code - it has 2 parts one is running in UI and one is code running in background. Call background code: workbench.getProgressService().busyCursorWhile(this); UI code is just updating user interface [-; Let's imagine that the background code has some synchronized section. It enters this synchronized section, and provides feedback to user using progress monitor. This synchronized is long running action. Also background thread/some other thread sent before/during background sync section some stuff to UI which also acquires this background thread lock. So what's the problem - when calling progress monitor AccumulatingProgressMonitor - this class acquires RunnableLock, but this RunnableLock has already been acquired by other UI runner (Display.asyncExec) when there was something to be sent to UI. The problem is generally about UI sync/asyncexec rules. I think that main problem is that AccumulatingProgressMonitor uses Display.syncExec in some parts. I think that any progressmonitor shouldn't acquire any lock and also shouldn't block processing anyhow, because this can cause such pains.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/AccumulatingProgressMonitor.java