Cleanup: Use int instead of long to avoid Interlocked.Read (#13069)

This commit is contained in:
xtqqczze
2020-07-10 11:43:41 -07:00
committed by GitHub
parent 3a2c164ec6
commit e41a28c2bd
@@ -53,7 +53,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
/// <param name="actionArgs">Event argument.</param>
protected void NewCmdletActionHandler(object cimSession, CmdletActionEventArgs actionArgs)
{
DebugHelper.WriteLogEx("Disposed {0}, action type = {1}", 0, this._disposed, actionArgs.Action);
DebugHelper.WriteLogEx("Disposed {0}, action type = {1}", 0, this.Disposed, actionArgs.Action);
if (this.Disposed)
{
@@ -443,11 +443,11 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
{
get
{
return Interlocked.Read(ref this._disposed) == 1;
return this._disposed == 1;
}
}
private long _disposed;
private int _disposed;
/// <summary>
/// <para>