diff --git a/Upsilon/StandardLibraries/StaticScope.cs b/Upsilon/StandardLibraries/StaticScope.cs index d38f7c2..1e7706e 100644 --- a/Upsilon/StandardLibraries/StaticScope.cs +++ b/Upsilon/StandardLibraries/StaticScope.cs @@ -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; + } } }