Files
mono/mcs/class/System.Private.CoreLib/System.Threading/WaitHandle.cs
T
Zoltan Varga 0f798ae6cf [netcore] Ongoing work. (#13357)
* [netcore] Implement MethodBody using internal Runtime* classes. Use the mono version for ModuleHandle.

* [netcore] Reflection fixes.

* Address review comments.

* [netcore] Implement RuntimeHelpers:GetUninitializedObject ().

* [netcore] Implement the Type::GetMethod () overload which has a genericParameterCount parameter.

* [netcore] Implement Thread.OptimalMaxSpinWaitsPerSpinIteration.

* Revert a change to fix a test failure.

* [netcore] Implement Marshal:GetExceptionForHRInternal ().

* [netcore] Implement GC:GetSegmentSize ().

* [runtime] Allow pointer type members in typed references.
2019-03-09 05:26:40 -05:00

30 lines
941 B
C#

using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Threading
{
partial class WaitHandle
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
unsafe static extern int Wait_internal(IntPtr* handles, int numHandles, bool waitAll, int ms);
static int WaitOneCore (IntPtr waitHandle, int millisecondsTimeout)
{
unsafe {
return Wait_internal (&waitHandle, 1, false, millisecondsTimeout);
}
}
[MethodImpl (MethodImplOptions.InternalCall)]
static extern int SignalAndWaitCore (IntPtr waitHandleToSignal, IntPtr waitHandleToWaitOn, int millisecondsTimeout);
internal static int WaitMultipleIgnoringSyncContext (Span<IntPtr> waitHandles, bool waitAll, int millisecondsTimeout)
{
unsafe {
fixed (IntPtr* handles = &MemoryMarshal.GetReference (waitHandles)) {
return Wait_internal (handles, waitHandles.Length, waitAll, millisecondsTimeout);
}
}
}
}
}