diff options
author | Thomas Watson | 2011-01-04 16:31:41 +0000 |
---|---|---|
committer | Thomas Watson | 2011-01-04 16:31:41 +0000 |
commit | 34ab819f404f5d3637dd3488339223269977db81 (patch) | |
tree | 4600084334b57383490e57fbe7e1e3cf1129d108 /bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi | |
parent | 02398da987840a1b73d15ffa60befc61301ee29b (diff) | |
download | rt.equinox.framework-34ab819f404f5d3637dd3488339223269977db81.tar.gz rt.equinox.framework-34ab819f404f5d3637dd3488339223269977db81.tar.xz rt.equinox.framework-34ab819f404f5d3637dd3488339223269977db81.zip |
Bug 330716 - Thread time-out value (5 seconds) should be configurable
Diffstat (limited to 'bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi')
-rw-r--r-- | bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java index 5f99fe9f2..d2a784926 100644 --- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java +++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/AbstractBundle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2010 IBM Corporation and others. + * Copyright (c) 2003, 2011 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 @@ -39,6 +39,19 @@ import org.osgi.framework.wiring.BundleWiring; * This class is abstract and is extended by BundleHost and BundleFragment. */ public abstract class AbstractBundle implements Bundle, Comparable<Bundle>, KeyedElement, BundleStartLevel, BundleReference { + private final static long STATE_CHANGE_TIMEOUT; + static { + long stateChangeWait = 5000; + try { + String prop = FrameworkProperties.getProperty("equinox.statechange.timeout"); //$NON-NLS-1$ + if (prop != null) + stateChangeWait = Long.parseLong(prop); + } catch (Throwable t) { + // use default 5000 + stateChangeWait = 5000; + } + STATE_CHANGE_TIMEOUT = stateChangeWait; + } /** The Framework this bundle is part of */ protected final Framework framework; /** The state of the bundle. */ @@ -1080,7 +1093,7 @@ public abstract class AbstractBundle implements Bundle, Comparable<Bundle>, Keye Debug.println(" Waiting for state to change in bundle " + this); //$NON-NLS-1$ start = System.currentTimeMillis(); } - statechangeLock.wait(5000); + statechangeLock.wait(STATE_CHANGE_TIMEOUT); /* * wait for other thread to * finish changing state |