8038502: Deflater.needsInput() should use synchronization
authorcoffeys
Thu, 15 Oct 2015 14:41:37 +0100
changeset 32995 a62c89adce3d
parent 32994 4dcdbdb9b2c3
child 32996 4c7779b44531
child 33653 c1ee09fe3274
8038502: Deflater.needsInput() should use synchronization Reviewed-by: chegar
jdk/src/java.base/share/classes/java/util/zip/Deflater.java
--- a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java	Thu Oct 15 13:56:39 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java	Thu Oct 15 14:41:37 2015 +0100
@@ -318,7 +318,9 @@
      * should be called in order to provide more input
      */
     public boolean needsInput() {
-        return len <= 0;
+        synchronized (zsRef) {
+            return len <= 0;
+        }
     }
 
     /**