Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Indexer/managedBuild hangs

Bonjour,
  A proposed (temporary ?) solution for the cdt hangs by wrapping
the task in a Job runnable.
Index: index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java,v
retrieving revision 1.26
diff -u -r1.26 SourceIndexerRequestor.java
--- index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java	31 Mar 2004 19:41:59 -0000	1.26
+++ index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java	1 Apr 2004 17:42:37 -0000
@@ -65,7 +65,11 @@
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
 
 /**
  * @author bgheorgh
@@ -116,9 +120,20 @@
 				 lineNumber = include.getStartingLine();
 			 }
 		  }
-		  
-	    addMarkers(tempFile,problem, lineNumber); 
-	      
+
+		  final IFile file = tempFile;
+		  final IProblem prob = problem;
+		  final int lineno = lineNumber;
+		  Job job = new Job("AddMarker.name") { //$NON-NLS-1$ 
+		  	protected IStatus run(IProgressMonitor monitor) {
+		  		addMarkers(file, prob, lineno); 
+		  		return Status.OK_STATUS;
+		  	}
+		  };
+		  job.setRule(file.getParent());
+		  job.schedule();
+
+	    //addMarkers(tempFile,problem, lineNumber); 
 		return DefaultProblemHandler.ruleOnProblem( problem, ParserMode.COMPLETE_PARSE );
 	}
 
@@ -220,9 +235,19 @@
 	public void enterInclusion(IASTInclusion inclusion) {
 		// TODO Auto-generated method stub
 		IPath newPath = new Path(inclusion.getFullFileName());
-		IFile tempFile = CCorePlugin.getWorkspace().getRoot().getFileForLocation(newPath);
+		final IFile tempFile = CCorePlugin.getWorkspace().getRoot().getFileForLocation(newPath);
 		if (tempFile !=null){
-			removeMarkers(tempFile);
+			  Job job = new Job("RemoveMarker.name") { //$NON-NLS-1$
+			  	 
+			  	protected IStatus run(IProgressMonitor monitor) {
+			  		removeMarkers(tempFile); 
+			  		return Status.OK_STATUS;
+			  	}
+			  };
+			  job.setRule(tempFile.getParent());
+			  job.schedule();
+
+			//removeMarkers(tempFile);
 		}
 		else{
 		 //File is out of workspace

Back to the top