Bug 173995 [Progress] Switch progress monitoring to asyncExec
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.
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/AccumulatingProgressMonitor.java
* </li>
 * <li> Subsequent calls to <code>worked</code> or <code>subtask</code> do not post
 *		a new runnable as long as a previous runnable still exists in the SWT event
 *		queue. In this case, the progress monitor just updates the internal state of
 *		the runnable that waits in the SWT event queue for its execution. If no runnable
 *		exists, a new one is created and posted into the event queue.
 * </ul>
 * <p>
 * This class is internal to the framework; clients outside JFace should not
 * use this class.
 * </p>
 */
class AccumulatingProgressMonitor extends ProgressMonitorWrapper {
    /**
     * The display.
     */
    private Display display;
    /**
     * The collector, or <code>null</code> if none.
     */
    private Collector collector;
    private String currentTask = ""; 
    private class Collector implements Runnable {
        private String subTask;
        private double worked;
        private IProgressMonitor monitor;
        /**
         * Create a new collector.
         * @param subTask
         * @param work