Cosmos/source/Cosmos.System2_Plugs/System/Threading/ThreadImpl.cs
fanoI e240641863 Created plugs to make Hashtable work (at least when an object is key).
There are issue however:
1. IL2CPU modifications are needed (see the PR for the list of the PR of IL2CPU to merge to make this usable)
2. Some fix in IL2CPU seems to give problems with Dictionary (VMT problem again?)
3. Hashtable with valuetype as key doesn't work (ContainsKey() always return false)
2018-02-25 15:27:39 +01:00

31 lines
795 B
C#

using System;
using Cosmos.HAL;
using IL2CPU.API.Attribs;
namespace Cosmos.System_Plugs.System.Threading
{
//[Plug(Target = typeof(Thread))]
[Plug(TargetName = "System.Threading.Thread")]
public static class ThreadImpl
{
public static void Sleep(TimeSpan timeout)
{
Global.PIT.Wait((uint)timeout.TotalMilliseconds);
}
public static void Sleep(int millisecondsTimeout)
{
Global.PIT.Wait((uint)millisecondsTimeout);
}
public static bool Yield()
{
throw new NotImplementedException("Thread.Yield()");
}
public static void SpinWaitInternal(object iterations)
{
throw new NotImplementedException("Thread.SpinWaitInternal()");
}
}
}