From ec714bb48eb5d63771b27fdf595951aad8bdb04c Mon Sep 17 00:00:00 2001 From: ZLoo Date: Thu, 18 Jul 2024 01:20:26 +0300 Subject: [PATCH] fix S3971 warning --- src/Polly/Polly.csproj | 2 +- src/Polly/Utilities/TimedLock.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Polly/Polly.csproj b/src/Polly/Polly.csproj index 177c9f8b3a0..a2535c2a0e8 100644 --- a/src/Polly/Polly.csproj +++ b/src/Polly/Polly.csproj @@ -8,7 +8,7 @@ 70 true $(NoWarn);CA1010;CA1031;CA1051;CA1062;CA1063;CA1064;CA1710;CA1716;CA1724;CA1805;CA1815;CA1816;CA2211 - $(NoWarn);S2223;S3215;S3246;S3971;S4039;S4457 + $(NoWarn);S2223;S3215;S3246;S4039;S4457 $(NoWarn);RS0037; diff --git a/src/Polly/Utilities/TimedLock.cs b/src/Polly/Utilities/TimedLock.cs index c215ef016f2..da5055fd2d1 100644 --- a/src/Polly/Utilities/TimedLock.cs +++ b/src/Polly/Utilities/TimedLock.cs @@ -32,7 +32,9 @@ private static TimedLock Lock(object o, TimeSpan timeout) if (!Monitor.TryEnter(o, timeout)) { #if DEBUG +#pragma warning disable S3971 // Do not call 'GC.SuppressFinalize' GC.SuppressFinalize(tl._leakDetector); +#pragma warning restore S3971 #endif throw new LockTimeoutException(); }