7017486: Need synchronized access when flushing the LDAP request queue
Reviewed-by: alanb
--- 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();
}
}