5 types derived from WaitHandle
System.Private.CoreLib (5)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (1)
80internal sealed class EventPipeWaitHandle : WaitHandle
src\libraries\System.Private.CoreLib\src\System\Threading\EventWaitHandle.cs (1)
11public partial class EventWaitHandle : WaitHandle
src\libraries\System.Private.CoreLib\src\System\Threading\Mutex.cs (1)
14public sealed partial class Mutex : WaitHandle
src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.cs (1)
11public sealed partial class Semaphore : WaitHandle
src\System\Threading\Mutex.CoreCLR.Unix.cs (1)
15public sealed partial class Mutex : WaitHandle
177 references to WaitHandle
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\AsyncResult.cs (1)
49public WaitHandle AsyncWaitHandle
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TimeoutHelper.cs (1)
210public static bool WaitOne(WaitHandle waitHandle, TimeSpan timeout)
http2cat (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
IIS.FunctionalTests (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
IIS.LongTests (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
IIS.NewHandler.FunctionalTests (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
IIS.NewShim.FunctionalTests (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
IIS.ShadowCopy.Tests (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
IISExpress.FunctionalTests (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.HttpLogging (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.OutputCaching (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.ResponseCaching (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.ResponseCompression (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.Server.HttpSys (5)
RequestProcessing\ClientCertLoader.cs (1)
331public WaitHandle AsyncWaitHandle
RequestProcessing\RequestStreamAsyncResult.cs (1)
162public WaitHandle AsyncWaitHandle
RequestProcessing\ResponseStreamAsyncResult.cs (1)
318public WaitHandle AsyncWaitHandle
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.Server.IIS (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.Server.Kestrel.Core (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\TaskToApm.cs (2)
116/// <summary>Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.</summary> 117public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
Microsoft.Maui.Resizetizer (3)
AsyncTask.cs (3)
274 WaitHandle[] handles = new WaitHandle[] { 286 var index = (WaitHandleIndex)System.Threading.WaitHandle.WaitAny(handles, TimeSpan.FromMilliseconds(10));
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1188[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.WaitHandle))]
netstandard (1)
netstandard.cs (1)
2151[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.WaitHandle))]
PresentationCore (1)
MS\Internal\IO\Packaging\NetStream.cs (1)
1086int index = WaitHandle.WaitAny(_readEventHandles);
PresentationFramework (1)
System\Windows\Documents\PageContentAsyncResult.cs (1)
87public WaitHandle AsyncWaitHandle
System.Collections.Concurrent (11)
System\Collections\Concurrent\BlockingCollection.cs (11)
971List<WaitHandle> handles = GetHandles(collections, externalCancellationToken, true, out collatedCancellationTokens); 987index = WaitHandle.WaitAny(handles.ToArray(), timeout); 998Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1000if (index == WaitHandle.WaitTimeout) //case#2 1048private static List<WaitHandle> GetHandles(BlockingCollection<T>[] collections, CancellationToken externalCancellationToken, bool isAddOperation, out CancellationToken[] cancellationTokens) 1051List<WaitHandle> handlesList = new List<WaitHandle>(collections.Length + 1); // + 1 for the external token handle to be added 1375List<WaitHandle> handles = GetHandles(collections, externalCancellationToken, false, out collatedCancellationTokens); 1387int index = WaitHandle.WaitAny(handles.ToArray(), timeout); 1396Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1397if (index == WaitHandle.WaitTimeout) //case#2
System.Data.Odbc (9)
Common\System\Data\ProviderBase\DbConnectionPool.cs (9)
47private readonly WaitHandle[] _handlesWithCreate; 48private readonly WaitHandle[] _handlesWithoutCreate; 56_handlesWithCreate = new WaitHandle[] { _poolSemaphore, _errorEvent, _creationSemaphore }; 57_handlesWithoutCreate = new WaitHandle[] { _poolSemaphore, _errorEvent }; 76internal WaitHandle[] GetHandles(bool withCreate) 733waitResult = WaitHandle.WaitAny(_waitHandles.GetHandles(allowCreate), unchecked((int)waitForMultipleObjectsTimeout)); 744case WaitHandle.WaitTimeout: 963waitResult = WaitHandle.WaitAny(_waitHandles.GetHandles(withCreate: true), CreationTimeout); 990else if (WaitHandle.WaitTimeout == waitResult)
System.Net.HttpListener (3)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
104public WaitHandle AsyncWaitHandle
System\Net\Managed\HttpStreamAsyncResult.cs (1)
84public WaitHandle AsyncWaitHandle
System\Net\Managed\ListenerAsyncResult.Managed.cs (1)
212public WaitHandle AsyncWaitHandle
System.Private.CoreLib (98)
src\libraries\Common\src\System\Threading\Tasks\TaskToAsyncResult.cs (1)
155public WaitHandle AsyncWaitHandle => ((IAsyncResult)_task).AsyncWaitHandle;
src\libraries\System.Private.CoreLib\src\System\GC.cs (2)
17=> WaitForFullGCApproach(WaitHandle.ToTimeoutMilliseconds(timeout)); 26=> WaitForFullGCComplete(WaitHandle.ToTimeoutMilliseconds(timeout));
src\libraries\System.Private.CoreLib\src\System\IAsyncResult.cs (1)
15WaitHandle AsyncWaitHandle { get; }
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (1)
197protected virtual WaitHandle CreateWaitHandle() => new ManualResetEvent(false);
src\libraries\System.Private.CoreLib\src\System\Threading\AbandonedMutexException.cs (4)
35public AbandonedMutexException(int location, WaitHandle? handle) 42public AbandonedMutexException(string? message, int location, WaitHandle? handle) 49public AbandonedMutexException(string? message, Exception? inner, int location, WaitHandle? handle) 63private void SetupException(int location, WaitHandle? handle)
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationToken.cs (3)
78/// Gets a <see cref="Threading.WaitHandle"/> that is signaled when the token is canceled.</summary> 80/// Accessing this property causes a <see cref="Threading.WaitHandle">WaitHandle</see> 87public WaitHandle WaitHandle => (_source ?? CancellationTokenSource.s_neverCanceledSource).WaitHandle;
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (2)
44/// <summary><see cref="Threading.WaitHandle"/> lazily initialized and returned from <see cref="WaitHandle"/>.</summary> 90internal WaitHandle WaitHandle
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (1)
226public bool TryEnter(TimeSpan timeout) => TryEnter_Outlined(WaitHandle.ToTimeoutMilliseconds(timeout));
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (3)
67/// Gets the underlying <see cref="Threading.WaitHandle"/> object for this <see 70/// <value>The underlying <see cref="Threading.WaitHandle"/> event object fore this <see 77public WaitHandle WaitHandle
src\libraries\System.Private.CoreLib\src\System\Threading\Monitor.cs (4)
11=> TryEnter(obj, WaitHandle.ToTimeoutMilliseconds(timeout)); 14=> TryEnter(obj, WaitHandle.ToTimeoutMilliseconds(timeout), ref lockTaken); 19public static bool Wait(object obj, TimeSpan timeout) => Wait(obj, WaitHandle.ToTimeoutMilliseconds(timeout)); 38=> Wait(obj, WaitHandle.ToTimeoutMilliseconds(timeout));
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (1)
483WaitHandle waitObject,
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (13)
151private readonly RegisteredWaitHandle[] _registeredWaits = new RegisteredWaitHandle[WaitHandle.MaxWaitHandles - 1]; 158private readonly SafeWaitHandle[] _waitHandles = new SafeWaitHandle[WaitHandle.MaxWaitHandles]; 167private readonly RegisteredWaitHandle?[] _pendingRemoves = new RegisteredWaitHandle[WaitHandle.MaxWaitHandles - 1]; 244int signaledHandleIndex = WaitHandle.WaitAny(new ReadOnlySpan<SafeWaitHandle>(_waitHandles, 0, numUserWaits + 1), timeoutDurationMs); 246if (signaledHandleIndex >= WaitHandle.WaitAbandoned && 247signaledHandleIndex < WaitHandle.WaitAbandoned + 1 + numUserWaits) 250Debug.Assert(signaledHandleIndex != WaitHandle.WaitAbandoned); // the first wait handle is an event 251signaledHandleIndex += WaitHandle.WaitSuccess - WaitHandle.WaitAbandoned; 259if (signaledHandleIndex != WaitHandle.WaitTimeout) 398if (_numUserWaits == WaitHandle.MaxWaitHandles - 1) 422/// As per CoreCLR's behavior, if the user passes in an invalid <see cref="WaitHandle"/> 423/// into <see cref="RegisteredWaitHandle.Unregister(WaitHandle)"/>, then the unregistration of the wait handle is blocking.
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (5)
11/// An object representing the registration of a <see cref="WaitHandle"/> via <see cref="ThreadPool.RegisterWaitForSingleObject"/>. 22/// The <see cref="WaitHandle"/> the user passed in via <see cref="Unregister(WaitHandle)"/>. 55internal RegisteredWaitHandle(WaitHandle waitHandle, _ThreadPoolWaitOrTimerCallback callbackHelper, 95private bool UnregisterPortableCore(WaitHandle waitObject)
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Unix.cs (2)
11/// An object representing the registration of a <see cref="WaitHandle"/> via <see cref="ThreadPool.RegisterWaitForSingleObject"/>. 60public bool Unregister(WaitHandle waitObject) => UnregisterPortableCore(waitObject);
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (4)
85/// Returns a <see cref="WaitHandle"/> that can be used to wait on the semaphore. 87/// <value>A <see cref="WaitHandle"/> that can be used to wait on the 97public WaitHandle AvailableWaitHandle 893WaitHandle? wh = m_waitHandle;
src\libraries\System.Private.CoreLib\src\System\Threading\SynchronizationContext.cs (1)
52return WaitHandle.WaitMultipleIgnoringSyncContext(waitHandles, waitAll, millisecondsTimeout);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
1412/// Gets a <see cref="WaitHandle"/> that can be used to wait for the task to 1423WaitHandle IAsyncResult.AsyncWaitHandle
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (2)
568public bool Join(TimeSpan timeout) => Join(WaitHandle.ToTimeoutMilliseconds(timeout)); 570public static void Sleep(TimeSpan timeout) => Sleep(WaitHandle.ToTimeoutMilliseconds(timeout));
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPool.Unix.cs (1)
81WaitHandle waitObject,
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (8)
1681WaitHandle waitObject, 1701WaitHandle waitObject, 1720WaitHandle waitObject, 1735WaitHandle waitObject, 1753WaitHandle waitObject, 1772WaitHandle waitObject, 1791WaitHandle waitObject, 1813WaitHandle waitObject,
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (6)
583public bool Dispose(WaitHandle toSignal) 621if (notifyWhenNoCallbacksRunning is WaitHandle) 702Debug.Assert(toSignal is WaitHandle || toSignal is Task); 704if (toSignal is WaitHandle wh) 808public bool Dispose(WaitHandle notifyObject) 958public bool Dispose(WaitHandle notifyObject)
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (24)
238ReadOnlySpan<WaitHandle> waitHandles, 251WaitHandle waitHandle = waitHandles[i] ?? throw new ArgumentNullException($"waitHandles[{i}]", SR.ArgumentNull_ArrayElement); 290private static int WaitMultiple(WaitHandle[] waitHandles, bool waitAll, int millisecondsTimeout) 294return WaitMultiple(new ReadOnlySpan<WaitHandle>(waitHandles), waitAll, millisecondsTimeout); 297private static int WaitMultiple(ReadOnlySpan<WaitHandle> waitHandles, bool waitAll, int millisecondsTimeout) 450private static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn, int millisecondsTimeout) 507public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout) => 509public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout) => 511public static bool WaitAll(WaitHandle[] waitHandles) => 513public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) => 515public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) => 518public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout) => 522internal static int WaitAny(ReadOnlySpan<WaitHandle> waitHandles, int millisecondsTimeout) => 524public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout) => 526public static int WaitAny(WaitHandle[] waitHandles) => 528public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) => 530public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) => 533public static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn) => 535public static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn, TimeSpan timeout, bool exitContext) => 537public static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn, int millisecondsTimeout, bool exitContext) =>
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandleExtensions.cs (4)
13/// <param name="waitHandle">The <see cref="WaitHandle"/> to operate on.</param> 15public static SafeWaitHandle GetSafeWaitHandle(this WaitHandle waitHandle) 25/// <param name="waitHandle">The <see cref="WaitHandle"/> to operate on.</param> 27public static void SetSafeWaitHandle(this WaitHandle waitHandle, SafeWaitHandle? value)
src\System\Threading\LowLevelLifoSemaphore.Unix.cs (3)
30Debug.Assert(waitResult == WaitHandle.WaitSuccess || waitResult == WaitHandle.WaitTimeout); 31return waitResult == WaitHandle.WaitSuccess;
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
840[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.WaitHandle))]
System.ServiceModel.Federation (1)
System\Runtime\OperationWithTimeoutAsyncResult.cs (1)
77public WaitHandle AsyncWaitHandle
System.Threading (3)
System\Threading\CountdownEvent.cs (3)
108/// Gets a <see cref="System.Threading.WaitHandle"/> that is used to wait for the event to be set. 110/// <value>A <see cref="System.Threading.WaitHandle"/> that is used to wait for the event to be set.</value> 117public WaitHandle WaitHandle
System.Transactions.Local (1)
System\Transactions\CommittableTransaction.cs (1)
193WaitHandle IAsyncResult.AsyncWaitHandle
System.Windows.Forms (3)
System\Windows\Forms\Control.cs (2)
3538private unsafe void WaitForWaitHandle(WaitHandle waitHandle) 6532using WaitHandle waitHandle = tme.AsyncWaitHandle;
System\Windows\Forms\Control.ThreadMethodEntry.cs (1)
49public WaitHandle AsyncWaitHandle
UnitTests.Common (1)
MockAsyncResult.cs (1)
28public WaitHandle AsyncWaitHandle { get; set; }
VBCSCompiler.UnitTests (2)
Extensions.cs (2)
19public static Task ToTask(this WaitHandle handle, int? timeoutMilliseconds) 39public static async Task WaitOneAsync(this WaitHandle handle, int? timeoutMilliseconds = null) => await handle.ToTask(timeoutMilliseconds);