The sslConfig field is read without holding serverSocketLock in accept(), while all other accesses are performed under the lock. Wrap the SSLSocketImpl construction with the lock to make the access consistent and avoid a potential data race. Use try/finally so the lock is always released, even if the constructor throws.
--------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - 8395367 SSLServerSocketImpl.accept() accesses sslConfig without holding serverSocketLock Changes: https://git.openjdk.org/jdk/pull/33491/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=33491&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8395367 Stats: 7 lines in 1 file changed: 6 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/33491.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/33491/head:pull/33491 PR: https://git.openjdk.org/jdk/pull/33491
