monitor.subTask("preparing"); Project findbugsProject = FindBugsWorker.workPrepare(files);   FindBugsWorker.UpdateJob updateJob = null; try { monitor.subTask("waiting to detect"); manager.beginRule(findbugsExecuteMutex, monitor); monitor.subTask("detecting"); updateJob = worker.workExecute(findbugsProject); } finally { manager.endRule(findbugsExecuteMutex); }  monitor.subTask("updating"); if (updateJob != null) {  updateJob.update(); }
findbugsExecuteLock.acquire(); worker.work(files);
	private void work(final IResource resource) {		try {			final Collection files = filesInResource(resource);			Job runFindBugs = new Job("Finding bugs in "+resource.getName()+"...") {				@Override				protected IStatus run(IProgressMonitor monitor) {					JobManager manager = JobManager.getInstance();					FindBugsWorker worker =						new FindBugsWorker(resource.getProject(), monitor);					try {						monitor.subTask("preparing");						Project findbugsProject = FindBugsWorker.workPrepare(files);						//call worker.workExecute(files) but with mutex rule						FindBugsWorker.UpdateJob updateJob = null;						try {							monitor.subTask("waiting to detect");							manager.beginRule(findbugsExecuteMutex, monitor);							monitor.subTask("detecting");							updateJob = worker.workExecute(findbugsProject);						} finally {							manager.endRule(findbugsExecuteMutex);						}												monitor.subTask("updating");						if (updateJob != null) {							//updateJob.schedule();							updateJob.update(); // update directly						}					} catch (CoreException e) {						e.printStackTrace();						return Status.CANCEL_STATUS;					}					return Status.OK_STATUS;				}			};			runFindBugs.setUser(true);			runFindBugs.schedule();		} catch (CoreException e1) {			// TODO Auto-generated catch block			e1.printStackTrace();		}	}