--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java Fri Mar 01 17:48:53 2019 +0100
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java Fri Mar 01 09:42:04 2019 -0800
@@ -916,12 +916,8 @@
/**
* Try the best to use up the input records so as to close the
* socket gracefully, without impact the performance too much.
- *
- * Note: please don't synchronize this method as the read() method
- * may hold the lock. A race should be fine as this method is
- * designed for cleanup only.
*/
- private void deplete() {
+ private synchronized void deplete() {
if (!conContext.isInboundClosed()) {
if (!(conContext.inputRecord instanceof SSLSocketInputRecord)) {
return;