Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ internal bool Compile(bool optimized)

private void InitializeMetadata()
{
lock (this)
lock (_lock)
{
if (_attributes != null)
{
Expand Down Expand Up @@ -132,7 +132,7 @@ private void InitializeMetadata()

private void CompileUnoptimized()
{
lock (this)
lock (_lock)
{
if (_compiledUnoptimized)
{
Expand All @@ -147,7 +147,7 @@ private void CompileUnoptimized()

private void CompileOptimized()
{
lock (this)
lock (_lock)
{
if (_compiledOptimized)
{
Expand Down Expand Up @@ -291,7 +291,7 @@ bool IsScriptBlockInFactASafeHashtable()

private IParameterMetadataProvider DelayParseScriptText()
{
lock (this)
lock (_lock)
{
if (_ast != null)
{
Expand Down Expand Up @@ -346,6 +346,8 @@ private IParameterMetadataProvider DelayParseScriptText()

internal IScriptExtent[] SequencePoints { get; set; }

private readonly object _lock = new object();

private RuntimeDefinedParameterDictionary _runtimeDefinedParameterDictionary;
private Attribute[] _attributes;
private bool _usesCmdletBinding;
Expand Down Expand Up @@ -473,7 +475,7 @@ internal ExperimentalAttribute ExperimentalAttribute
{
if (_expAttribute == ExperimentalAttribute.None)
{
lock (this)
lock (_lock)
{
if (_expAttribute == ExperimentalAttribute.None)
{
Expand All @@ -492,7 +494,7 @@ public MergedCommandParameterMetadata GetParameterMetadata(ScriptBlock scriptBlo
{
if (_parameterMetadata == null)
{
lock (this)
lock (_lock)
{
if (_parameterMetadata == null)
{
Expand Down