changeset 3651:b0bd638036bd

7017486: Need synchronized access when flushing the LDAP request queue Reviewed-by: alanb
author vinnie
date Mon, 07 Feb 2011 09:11:26 +0000
parents a775b8d3fed0
children f34dcfeecc8d
files src/share/classes/com/sun/jndi/ldap/Connection.java
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/jndi/ldap/Connection.java	Fri Feb 04 17:29:16 2011 -0800
+++ b/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();
         }
     }