Nullify SemaphoreSlimContext

This commit is contained in:
Jordan Dominion
2023-11-23 19:37:35 -05:00
parent bcd875e606
commit b191d0a0c9
@@ -2,8 +2,6 @@
using System.Threading;
using System.Threading.Tasks;
#nullable disable
namespace Tgstation.Server.Host.Utils
{
/// <summary>
@@ -30,7 +28,7 @@ namespace Tgstation.Server.Host.Utils
/// <param name="semaphore">The <see cref="SemaphoreSlim"/> to lock.</param>
/// <param name="locked">The <see cref="bool"/> result of the lock attempt.</param>
/// <returns>A <see cref="SemaphoreSlimContext"/> for the lock on success, or <see langword="null"/> if it was not acquired.</returns>
public static SemaphoreSlimContext TryLock(SemaphoreSlim semaphore, out bool locked)
public static SemaphoreSlimContext? TryLock(SemaphoreSlim semaphore, out bool locked)
{
ArgumentNullException.ThrowIfNull(semaphore);
locked = semaphore.Wait(TimeSpan.Zero);