Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-07-02 16:41:11 -0400
committerThomas Watson2008-07-02 16:41:11 -0400
commitb6d3f893a353419b657206204188cef838a9f700 (patch)
tree5723b658aa6183a097c47e9a5da46ee07b3536de /bundles
parent734dcb08ef2c04e7ce525f4889fa22770bc82ac0 (diff)
downloadrt.equinox.framework-b6d3f893a353419b657206204188cef838a9f700.tar.gz
rt.equinox.framework-b6d3f893a353419b657206204188cef838a9f700.tar.xz
rt.equinox.framework-b6d3f893a353419b657206204188cef838a9f700.zip
Bug 239353 After install launcher restarts in infinite loop
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java40
1 files changed, 24 insertions, 16 deletions
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
index 43c241805..adbb62a4d 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
@@ -315,13 +315,17 @@ public class EclipseStarter {
context.removeBundleListener(loadBundleListener);
}
- if ("true".equals(FrameworkProperties.getProperty(PROP_REFRESH_BUNDLES)) && refreshPackages(getCurrentBundles(false))) //$NON-NLS-1$
+ if (startBundles[0] == null) {
+ waitForShutdown();
+ return context; // cannot continue; loadBasicBundles caused refreshPackages to shutdown the framework
+ }
+ if ("true".equals(FrameworkProperties.getProperty(PROP_REFRESH_BUNDLES)) && refreshPackages(getCurrentBundles(false))) { //$NON-NLS-1$
+ waitForShutdown();
return context; // cannot continue; refreshPackages shutdown the framework
+ }
if (Profile.PROFILE && Profile.STARTUP)
Profile.logTime("EclipseStarter.startup()", "loading basic bundles"); //$NON-NLS-1$ //$NON-NLS-2$
- if (startBundles[0] == null)
- return context; // cannot continue; loadBasicBundles caused refreshPackages to shutdown the framework
// set the framework start level to the ultimate value. This will actually start things
// running if they are persistently active.
setStartLevel(getStartLevel());
@@ -728,23 +732,27 @@ public class EclipseStarter {
packageAdmin.refreshPackages(bundles);
context.ungetService(packageAdminRef);
updateSplash(semaphore, listener);
- if (isForcedRestart()) {
- // wait for the system bundle to stop
- Bundle systemBundle = context.getBundle(0);
- int i = 0;
- while (i < 5000 && (systemBundle.getState() & (Bundle.ACTIVE | Bundle.STOPPING)) != 0) {
- i += 200;
- try {
- Thread.sleep(200);
- } catch (InterruptedException e) {
- break;
- }
- }
+ if (isForcedRestart())
return true;
- }
return false;
}
+ private static void waitForShutdown() {
+ if (!isForcedRestart())
+ return;
+ // wait for the system bundle to stop
+ Bundle systemBundle = context.getBundle(0);
+ int i = 0;
+ while (i < 5000 && (systemBundle.getState() & (Bundle.ACTIVE | Bundle.STOPPING)) != 0) {
+ i += 200;
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ break;
+ }
+ }
+ }
+
/**
* Invokes the OSGi Console on another thread
*

Back to the top