7065972: Some race condition may happen in SSLSocketImpl class
Reviewed-by: wetmore, weijun, dgu
--- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Tue Jul 19 17:45:11 2011 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java Tue Jul 19 21:47:23 2011 -0700
@@ -2443,11 +2443,12 @@
entrySet, HandshakeCompletedEvent e) {
super("HandshakeCompletedNotify-Thread");
- targets = entrySet;
+ targets = new HashSet<>(entrySet); // clone the entry set
event = e;
}
public void run() {
+ // Don't need to synchronize, as it only runs in one thread.
for (Map.Entry<HandshakeCompletedListener,AccessControlContext>
entry : targets) {