Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WaitAnyMultiple()

static int System.Threading.WaitHandle.WaitAnyMultiple ( ReadOnlySpan< SafeWaitHandle > safeWaitHandles,
int millisecondsTimeout )
inlinestaticprivate

Definition at line 286 of file WaitHandle.cs.

287 {
288 SynchronizationContext current = SynchronizationContext.Current;
289 if (current != null && current.IsWaitNotificationRequired())
290 {
291 IntPtr[] array = new IntPtr[safeWaitHandles.Length];
292 for (int i = 0; i < safeWaitHandles.Length; i++)
293 {
294 array[i] = safeWaitHandles[i].DangerousGetHandle();
295 }
296 return current.Wait(array, waitAll: false, millisecondsTimeout);
297 }
298 Span<IntPtr> waitHandles = stackalloc IntPtr[safeWaitHandles.Length];
299 for (int j = 0; j < safeWaitHandles.Length; j++)
300 {
301 waitHandles[j] = safeWaitHandles[j].DangerousGetHandle();
302 }
303 return WaitMultipleIgnoringSyncContext(waitHandles, waitAll: false, millisecondsTimeout);
304 }
static unsafe int WaitMultipleIgnoringSyncContext(Span< IntPtr > waitHandles, bool waitAll, int millisecondsTimeout)
Definition WaitHandle.cs:69

References System.array, System.Threading.SynchronizationContext.Current, System.Threading.SynchronizationContext.IsWaitNotificationRequired(), System.ReadOnlySpan< T >.Length, System.millisecondsTimeout, System.Threading.SynchronizationContext.Wait(), and System.Threading.WaitHandle.WaitMultipleIgnoringSyncContext().

Referenced by System.Threading.WaitHandle.WaitAny().