7065972: Some race condition may happen in SSLSocketImpl class

Reviewed-by: wetmore, weijun, dgu
This commit is contained in:
Xue-Lei Andrew Fan 2011-07-19 21:47:23 -07:00
parent f106ea9ed6
commit 7b1c8be3d3

View File

@ -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<HandshakeCompletedListener,AccessControlContext>
entry : targets) {