Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 66429

Summary: busyCursorWhile syncExecs in UIThread
Product: [Eclipse Project] Platform Reporter: Tod Creasey <Tod_Creasey>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P2 CC: cocoakevin, Darin_Swanson
Version: 3.0   
Target Milestone: 3.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 64928, 65504    

Description Tod Creasey CLA 2004-06-09 17:45:16 EDT
20040608

We are syncExecing in the UIThread - we need to check what Thread we are in 
before we do this.

Here is the patch to do this check

Index: ProgressMonitorJobsDialog.java
===================================================================
RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse 
UI/org/eclipse/ui/internal/progress/ProgressMonitorJobsDialog.java,v
retrieving revision 1.20
diff -u -r1.20 ProgressMonitorJobsDialog.java
--- ProgressMonitorJobsDialog.java	9 Jun 2004 18:30:53 -0000	1.20
+++ ProgressMonitorJobsDialog.java	9 Jun 2004 21:41:59 -0000
@@ -308,6 +308,12 @@
 			 * Open the dialog in the ui Thread
 			 */
 			private void openDialog() {
+				//Are we in the UI Thread?
+				if(Thread.currentThread() == getParentShell
().getDisplay().getThread()){
+					if(!alreadyClosed)
+						open();
+					return;
+				}
 				getParentShell().getDisplay().syncExec(new 
Runnable(){
 					/* (non-Javadoc)
 					 * @see java.lang.Runnable#run()
Comment 1 Kevin Barnes CLA 2004-06-09 18:21:12 EDT
Why is calling syncExec() from the UI thread an issue? The synchronizer should just call the run method 
and return because it's already running in the thread that it needs to be in.

From Synchronizer:

protected void syncExec (Runnable runnable) {
	if (display.isValidThread ()) {
		if (runnable != null) runnable.run ();
		return;
	}
...
Comment 2 Tod Creasey CLA 2004-06-10 07:50:33 EDT
I am going to investigate - it shouldn't be but it is what was blocking you.
Comment 3 Tod Creasey CLA 2004-06-10 09:04:25 EDT
This isn't the problem - the problem was that noitification of blockingwas not 
getting through