1 11 12 package org.eclipse.ant.internal.ui.editor; 13 14 import org.eclipse.ant.internal.ui.editor.utils.ProjectHelper; 15 16 17 public class DecayCodeCompletionDataStructuresThread extends Thread { 18 19 private static final int fgDelay= 6000 * 5; 21 private static DecayCodeCompletionDataStructuresThread fgInstance; 22 23 public static DecayCodeCompletionDataStructuresThread getDefault() { 24 if (fgInstance == null) { 25 fgInstance= new DecayCodeCompletionDataStructuresThread(); 26 } 27 return fgInstance; 28 } 29 30 34 private DecayCodeCompletionDataStructuresThread() { 35 super("Decay Ant Data Structures"); setPriority(Thread.MIN_PRIORITY); 37 setDaemon(true); 38 fgInstance= this; 39 setContextClassLoader(null); } 41 42 49 public void run() { 50 synchronized (this) { 51 try { 52 wait(fgDelay); 53 AntEditorCompletionProcessor.resetCodeCompletionDataStructures(); 54 ProjectHelper.reset(); 55 } catch (InterruptedException x) { 56 } 57 } 58 } 59 60 63 public static void cancel() { 64 if (fgInstance != null) { 65 synchronized (fgInstance) { 66 fgInstance.interrupt(); 67 fgInstance= null; 68 } 69 } 70 } 71 } 72 | Popular Tags |