Skip to content

Commit

Permalink
Compensate for CsWin32 HANDLE type change
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Feb 6, 2025
1 parent 3305b9f commit 15cfcdb
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static SynchronizationContext Default
/// <returns>
/// The array index of the object that satisfied the wait.
/// </returns>
public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)
public override unsafe int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)
{
Requires.NotNull(waitHandles, nameof(waitHandles));

Expand All @@ -61,7 +61,10 @@ public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTim
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
#endif
{
return (int)PInvoke.WaitForMultipleObjects(MemoryMarshal.Cast<IntPtr, HANDLE>(waitHandles), waitAll, (uint)millisecondsTimeout);
fixed (IntPtr* pHandles = waitHandles)
{
return (int)PInvoke.WaitForMultipleObjects((uint)waitHandles.Length, (HANDLE*)pHandles, waitAll, (uint)millisecondsTimeout);
}
}
else
{
Expand Down

0 comments on commit 15cfcdb

Please sign in to comment.