changeset 12880:91fc3c3826e6

8038502: Deflater.needsInput() should use synchronization Reviewed-by: chegar
author coffeys
date Thu, 15 Oct 2015 14:41:37 +0100
parents 63ddd8dea0ff
children 34d73930289e 55573c377d64
files src/java.base/share/classes/java/util/zip/Deflater.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/util/zip/Deflater.java	Thu Oct 15 13:56:39 2015 +0300
+++ b/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;
+        }
     }
 
     /**