mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-25 14:06:41 +01:00
Nullify SemaphoreSlimContext
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user