From ea8ffd55d8d0dfff7571fd6495a6b459cba7ef0d Mon Sep 17 00:00:00 2001 From: xuelei Date: Tue, 19 Jul 2011 21:47:23 -0700 Subject: [PATCH] 7065972: Some race condition may happen in SSLSocketImpl class Reviewed-by: wetmore, weijun, dgu --- src/share/classes/sun/security/ssl/SSLSocketImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/share/classes/sun/security/ssl/SSLSocketImpl.java b/src/share/classes/sun/security/ssl/SSLSocketImpl.java index d12eaf1c0..89907932b 100644 --- a/src/share/classes/sun/security/ssl/SSLSocketImpl.java +++ b/src/share/classes/sun/security/ssl/SSLSocketImpl.java @@ -2443,11 +2443,12 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl { 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 entry : targets) { -- GitLab