From 635e7791a5840d95212a0b62a4e3ec5eae0e16fa Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Mon, 19 Oct 2009 12:56:57 -0700 Subject: Fix a deadlock when ADT starts, starts building projects, and load the SDK at the same time. --- .../src/com/android/ide/eclipse/adt/AdtPlugin.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java index a52599f..5d8b6c2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java @@ -1045,12 +1045,12 @@ public class AdtPlugin extends AbstractUIPlugin { } } + ArrayList list = new ArrayList(); synchronized (getSdkLockObject()) { mSdkIsLoaded = LoadStatus.LOADED; progress.setTaskName("Check Projects"); - ArrayList list = new ArrayList(); for (IJavaProject javaProject : mPostLoadProjectsToResolve) { if (javaProject.getProject().isOpen()) { list.add(javaProject); @@ -1059,24 +1059,24 @@ public class AdtPlugin extends AbstractUIPlugin { // done with this list. mPostLoadProjectsToResolve.clear(); + } - // check the projects that need checking. - // The method modifies the list (it removes the project that - // do not need to be resolved again). - AndroidClasspathContainerInitializer.checkProjectsCache( - mPostLoadProjectsToCheck); - - list.addAll(mPostLoadProjectsToCheck); + // check the projects that need checking. + // The method modifies the list (it removes the project that + // do not need to be resolved again). + AndroidClasspathContainerInitializer.checkProjectsCache( + mPostLoadProjectsToCheck); - // update the project that needs recompiling. - if (list.size() > 0) { - IJavaProject[] array = list.toArray( - new IJavaProject[list.size()]); - AndroidClasspathContainerInitializer.updateProjects(array); - } + list.addAll(mPostLoadProjectsToCheck); - progress.worked(10); + // update the project that needs recompiling. + if (list.size() > 0) { + IJavaProject[] array = list.toArray( + new IJavaProject[list.size()]); + AndroidClasspathContainerInitializer.updateProjects(array); } + + progress.worked(10); } // Notify resource changed listeners -- cgit v1.1