Lock evaluation scope when not created to prevent threading issues

This commit is contained in:
Deukhoofd committed 2019-01-22 16:53:22 +01:00
1 parent 750d5dab8d
commit 8bd5f7d0af
1 file changed
+7 -5
+7 -5
View File
@@ -27,11 +27,13 @@ namespace Upsilon.StandardLibraries
{
if (_staticScope != null)
return _staticScope;
var (evaluationScope, boundScope) = CreateStandardLibrary();
_staticScope = evaluationScope;
_staticBoundScope = boundScope;
return _staticScope;
lock (Scope)
{
var (evaluationScope, boundScope) = CreateStandardLibrary();
_staticScope = evaluationScope;
_staticBoundScope = boundScope;
return _staticScope;
}
}
}