Add synchronization to CoerceJavaToLua.COERCIONS map.

This commit is contained in:
James Roseborough
2018-09-13 11:53:24 +02:00
parent 828e4be019
commit 194b776317
2 changed files with 3 additions and 1 deletions

View File

@@ -1020,6 +1020,7 @@ and at <a href="http://luaj.sourceforge.net/api/2.0/index.html">http://luaj.sour
<tr valign="top"><td>&nbsp;&nbsp;<b>3.0.2</b></td><td><ul>
<li>Fix JsePlatform.luaMain() to provide an "arg" table in the chunk's environment.</li>
<li>Let JsePlatform.luaMain() return values returned by the main chunk.</li>
<li>Add synchronization to CoerceJavaToLua.COERCIONS map.</li>
</ul></td></tr>
</table></td></tr></table>

View File

@@ -21,6 +21,7 @@
******************************************************************************/
package org.luaj.vm2.lib.jse;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -133,7 +134,7 @@ public class CoerceJavaToLua {
}
static final Map COERCIONS = new HashMap();
static final Map COERCIONS = Collections.synchronizedMap(new HashMap());
static {
Coercion boolCoercion = new BoolCoercion() ;