7017486: Need synchronized access when flushing the LDAP request queue
authorvinnie
Mon, 07 Feb 2011 09:11:26 +0000
changeset 8182 1afdfa9621b6
parent 8181 b2519f6074de
child 8183 06852303ca4e
7017486: Need synchronized access when flushing the LDAP request queue Reviewed-by: alanb
jdk/src/share/classes/com/sun/jndi/ldap/Connection.java
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java	Fri Feb 04 17:29:16 2011 -0800
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java	Mon Feb 07 09:11:26 2011 +0000
@@ -656,14 +656,17 @@
                 }
                 nparent = notifyParent;
             }
-        }
-        if (nparent) {
-            LdapRequest ldr = pendingRequests;
-            while (ldr != null) {
-                ldr.notify();
-                ldr = ldr.next;
+            if (nparent) {
+                LdapRequest ldr = pendingRequests;
+                while (ldr != null) {
+
+                    synchronized (ldr) {
+                        ldr.notify();
+                        ldr = ldr.next;
+                    }
+                }
+                parent.processConnectionClosure();
             }
-            parent.processConnectionClosure();
         }
     }