mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using System.Threading;
|
|
using IL2CPU.API.Attribs;
|
|
|
|
namespace Cosmos.Core_Plugs.System.Threading
|
|
{
|
|
[Plug("System.Threading.Thread, System.Private.CoreLib")]
|
|
public static class ThreadImpl
|
|
{
|
|
public static Thread GetCurrentThreadNative()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public static void MemoryBarrier()
|
|
{
|
|
|
|
}
|
|
|
|
// public static void SleepInternal(int ms)
|
|
// {
|
|
// // Implementation of http://referencesource.microsoft.com/#mscorlib/system/threading/thread.cs,6a577476abf2f437,references
|
|
// // see https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx for more details
|
|
|
|
// if ((ms > 0) && (ms != Timeout.Infinite))
|
|
// {
|
|
// double fac = CPU.GetCycleRate() / 1000d;
|
|
// double ticks = ms / 1000d * Stopwatch.Frequency + CPU.GetCycleCount() * fac;
|
|
|
|
// while (ticks < CPU.GetCycleCount() * fac)
|
|
// new Action(() => { }).Invoke(); // execute an empty operation
|
|
// }
|
|
// else if (ms < 0)
|
|
// throw new ThreadInterruptedException();
|
|
// }
|
|
}
|
|
}
|