From e41a28c2bd812b9ab69f89067e82cfa015bf6bc3 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 10 Jul 2020 19:43:41 +0100 Subject: [PATCH] Cleanup: Use `int` instead of `long` to avoid `Interlocked.Read` (#13069) --- .../CimAsyncOperation.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs index 1e21b78174..9cf9589326 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs @@ -53,7 +53,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// Event argument. 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; /// ///