diff options
author | Thomas Watson | 2006-03-16 21:06:19 +0000 |
---|---|---|
committer | Thomas Watson | 2006-03-16 21:06:19 +0000 |
commit | 5f8ce7856e86ceba0c37371f74f501769481eb8d (patch) | |
tree | eab28c132dffc26d72f5a429513f347f1f7a978a | |
parent | 1f558f62a16294ec26ec627495d2515bcf2260ca (diff) | |
download | rt.equinox.framework-5f8ce7856e86ceba0c37371f74f501769481eb8d.tar.gz rt.equinox.framework-5f8ce7856e86ceba0c37371f74f501769481eb8d.tar.xz rt.equinox.framework-5f8ce7856e86ceba0c37371f74f501769481eb8d.zip |
Bug 132239 Deadlock during Framework.close
-rw-r--r-- | bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java index 1304af9ff..612c4c1d8 100644 --- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java +++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java @@ -97,7 +97,7 @@ public class Framework implements EventDispatcher, EventPublisher { protected ConditionalPermissionAdminImpl condPermAdmin; SecureAction secureAction = new SecureAction(); // cache of AdminPermissions keyed by Bundle ID - private HashMap adminPermissions; + private HashMap adminPermissions = new HashMap(); // we need to hold these so that we can unregister them at shutdown private StreamHandlerFactory streamHandlerFactory; @@ -1268,21 +1268,21 @@ public class Framework implements EventDispatcher, EventPublisher { // gets AdminPermission objects from a cache to reduce the number of AdminPermission // objects that are created. - private synchronized AdminPermission getAdminPermission(Bundle bundle, String action) { - if (adminPermissions == null) - adminPermissions = new HashMap(); - Long ID = new Long(bundle.getBundleId()); - HashMap bundlePermissions = (HashMap) adminPermissions.get(ID); - if (bundlePermissions == null) { - bundlePermissions = new HashMap(); - adminPermissions.put(ID, bundlePermissions); - } - AdminPermission result = (AdminPermission) bundlePermissions.get(action); - if (result == null) { - result = new AdminPermission(bundle, action); - bundlePermissions.put(action, result); + private AdminPermission getAdminPermission(Bundle bundle, String action) { + synchronized(adminPermissions) { + Long ID = new Long(bundle.getBundleId()); + HashMap bundlePermissions = (HashMap) adminPermissions.get(ID); + if (bundlePermissions == null) { + bundlePermissions = new HashMap(); + adminPermissions.put(ID, bundlePermissions); + } + AdminPermission result = (AdminPermission) bundlePermissions.get(action); + if (result == null) { + result = new AdminPermission(bundle, action); + bundlePermissions.put(action, result); + } + return result; } - return result; } /** |