Lock Variables while adding to it to prevent threading issues

This commit is contained in:
Deukhoofd 2019-01-22 20:35:23 +01:00
parent 4062d2f140
commit b743759146
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 13 additions and 10 deletions

View File

@ -39,6 +39,8 @@ namespace Upsilon.Evaluator
}
public void AssignToNearest(VariableSymbol symbol, ScriptType value)
{
lock (Variables)
{
if (Variables.ContainsKey(symbol.Name))
{
@ -53,6 +55,7 @@ namespace Upsilon.Evaluator
Variables.Add(symbol.Name, value);
}
}
}
public void CreateLocal(VariableSymbol symbol, ScriptType value)
{