Use the new more efficient .NET 9 Lock type (#18015)
This commit is contained in:
@@ -12,7 +12,7 @@ public static class WaitHandleExtensions
|
||||
public static Task WaitOneAsync(this WaitHandle handle, int millisecondsTimeout = Timeout.Infinite)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<object?>();
|
||||
var callbackHandleInitLock = new object();
|
||||
var callbackHandleInitLock = new Lock();
|
||||
lock (callbackHandleInitLock)
|
||||
{
|
||||
RegisteredWaitHandle? callbackHandle = null;
|
||||
|
||||
Reference in New Issue
Block a user