Fixes illegal behavior of UnicodeSupport during multi-threaded build

This commit is contained in:
konsoletyper 2014-02-28 14:31:22 +04:00
parent cc8d2b8903
commit 723ad74f2e
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -85,7 +85,7 @@
</goals>
<phase>process-test-classes</phase>
<configuration>
<minifying>false</minifying>
<minifying>true</minifying>
<numThreads>1</numThreads>
<scanDependencies>true</scanDependencies>
<outputDir>${project.build.directory}/javascript-tck</outputDir>