From dcef7be2385fd190b64c7bc4badd1693502f478b Mon Sep 17 00:00:00 2001 From: Space Time Date: Fri, 20 Dec 2024 00:50:13 +0800 Subject: [PATCH] =?UTF-8?q?1.1.3=20->=201.1.4=20=E7=AC=AC83=E6=AC=A1?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utils/NginxCleaner.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Utils/NginxCleaner.cs b/Utils/NginxCleaner.cs index 34b1019..4b8b1bb 100644 --- a/Utils/NginxCleaner.cs +++ b/Utils/NginxCleaner.cs @@ -9,11 +9,11 @@ namespace Sheas_Cealer.Utils { internal static class NginxCleaner { - private static readonly object IsCleaningLock = new(); + private static readonly SemaphoreSlim IsCleaningSemaphore = new(1); internal static async Task Clean() { - if (!Monitor.TryEnter(IsCleaningLock)) + if (!await IsCleaningSemaphore.WaitAsync(0)) return; try @@ -40,7 +40,7 @@ namespace Sheas_Cealer.Utils certStore.Close(); } - finally { Monitor.Exit(IsCleaningLock); } + finally { IsCleaningSemaphore.Release(); } } } } \ No newline at end of file