diff options
author | Thomas Watson | 2007-04-17 15:05:30 +0000 |
---|---|---|
committer | Thomas Watson | 2007-04-17 15:05:30 +0000 |
commit | a246a3dda876bbdea39ede7d0f62ad6013deda4c (patch) | |
tree | 27386fef8e80faee7d43a8e4432491d446723f95 /bundles/org.eclipse.osgi | |
parent | 7d97dbd03d6a0b5a004018be61f8c8a6d95ece34 (diff) | |
download | rt.equinox.framework-a246a3dda876bbdea39ede7d0f62ad6013deda4c.tar.gz rt.equinox.framework-a246a3dda876bbdea39ede7d0f62ad6013deda4c.tar.xz rt.equinox.framework-a246a3dda876bbdea39ede7d0f62ad6013deda4c.zip |
Bug 182764 An IllegalStateException may occur if system bundle is stopped
Diffstat (limited to 'bundles/org.eclipse.osgi')
-rw-r--r-- | bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java index e392bd002..4670a1641 100644 --- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java +++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,7 +23,7 @@ import org.eclipse.osgi.service.runnable.*; import org.osgi.framework.*; public class EclipseAppLauncher implements ApplicationLauncher { - private ParameterizedRunnable runnable = null; + volatile private ParameterizedRunnable runnable = null; private Object appContext = null; private Semaphore runningLock = new Semaphore(1); private Semaphore waitForAppLock = new Semaphore(0); @@ -129,8 +129,9 @@ public class EclipseAppLauncher implements ApplicationLauncher { // all future application launches. if (runningLock.acquire(-1)) return; // no application is currently running. - if (runnable instanceof ApplicationRunnable) { - ((ApplicationRunnable)runnable).stop(); + ParameterizedRunnable currentRunnable = runnable; + if (currentRunnable instanceof ApplicationRunnable) { + ((ApplicationRunnable)currentRunnable).stop(); runningLock.acquire(60000); // timeout after 1 minute. } } |