changeset 3074:6b4e02e3be8e

6850402: Deadlock on sun.security.jca.ProviderConfig starting from jdk7-b55 Summary: Reduced the scope of locking Reviewed-by: vinnie
author valeriep
date Thu, 14 Oct 2010 18:01:47 -0700
parents 96d78263fdf7
children 4cf17a89ead9
files src/share/classes/sun/security/jca/Providers.java
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/jca/Providers.java	Thu Oct 14 17:59:58 2010 -0700
+++ b/src/share/classes/sun/security/jca/Providers.java	Thu Oct 14 18:01:47 2010 -0700
@@ -159,15 +159,18 @@
      * could not be loaded) removed. This is the list we need to
      * present to applications.
      */
-    public static synchronized ProviderList getFullProviderList() {
-        ProviderList list = getThreadProviderList();
-        if (list != null) {
-            ProviderList newList = list.removeInvalid();
-            if (newList != list) {
-                changeThreadProviderList(newList);
-                list = newList;
+    public static ProviderList getFullProviderList() {
+        ProviderList list;
+        synchronized (Providers.class) {
+            list = getThreadProviderList();
+            if (list != null) {
+                ProviderList newList = list.removeInvalid();
+                if (newList != list) {
+                    changeThreadProviderList(newList);
+                    list = newList;
+                }
+                return list;
             }
-            return list;
         }
         list = getSystemProviderList();
         ProviderList newList = list.removeInvalid();