changeset 676:1b6a0dc0ea16

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 12 Apr 2016 19:44:32 -0600
parents d95caff8ba8c
children 5c85d38659db
files core/src/luan/impl/LuanParser.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r d95caff8ba8c -r 1b6a0dc0ea16 core/src/luan/impl/LuanParser.java
--- a/core/src/luan/impl/LuanParser.java	Tue Apr 12 19:41:26 2016 -0600
+++ b/core/src/luan/impl/LuanParser.java	Tue Apr 12 19:44:32 2016 -0600
@@ -5,6 +5,7 @@
 import java.util.Arrays;
 import java.util.List;
 import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
 import luan.Luan;
 import luan.LuanState;
 import luan.LuanTable;
@@ -1746,7 +1747,7 @@
 
 
 
-	private static int classCounter = 0;
+	private static AtomicInteger classCounter = new AtomicInteger();
 
 	private enum Val { SINGLE, ARRAY }
 
@@ -1838,7 +1839,7 @@
 		String code = concat(stmt.list);
 //System.out.println("code:\n"+code);
 
-		String className = "EXP" + ++classCounter;
+		String className = "EXP" + classCounter.incrementAndGet();
 		String classCode = ""
 			+"package luan.impl;\n"
 			+"import luan.Luan;\n"