From 723ad74f2e66a519aea060a1b8dcb85d545a95f0 Mon Sep 17 00:00:00 2001 From: konsoletyper Date: Fri, 28 Feb 2014 14:31:22 +0400 Subject: [PATCH] Fixes illegal behavior of UnicodeSupport during multi-threaded build --- .../java/org/teavm/classlib/impl/unicode/UnicodeSupport.java | 3 ++- teavm-html4j/pom.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/impl/unicode/UnicodeSupport.java b/teavm-classlib/src/main/java/org/teavm/classlib/impl/unicode/UnicodeSupport.java index 9f33d0a5f..9a5ea3097 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/impl/unicode/UnicodeSupport.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/impl/unicode/UnicodeSupport.java @@ -30,7 +30,7 @@ import org.teavm.common.IntegerArray; */ public class UnicodeSupport { private static AtomicBoolean filled = new AtomicBoolean(); - private static volatile CountDownLatch latch = new CountDownLatch(0); + private static volatile CountDownLatch latch = new CountDownLatch(1); private static int[] digitValues; private static void parseUnicodeData() { @@ -130,6 +130,7 @@ public class UnicodeSupport { private static void ensureUnicodeData() { if (filled.compareAndSet(false, true)) { parseUnicodeData(); + latch.countDown(); latch = null; } else { CountDownLatch latchCopy = latch; diff --git a/teavm-html4j/pom.xml b/teavm-html4j/pom.xml index 3990ca7bc..0e6ff5096 100644 --- a/teavm-html4j/pom.xml +++ b/teavm-html4j/pom.xml @@ -85,7 +85,7 @@ process-test-classes - false + true 1 true ${project.build.directory}/javascript-tck