2018-05-10 08:37:03 +00:00
|
|
|
using System;
|
|
|
|
using System.Threading;
|
|
|
|
|
2017-06-07 13:16:24 +00:00
|
|
|
namespace Internal.Runtime.Augments
|
|
|
|
{
|
2018-01-29 19:03:06 +00:00
|
|
|
class RuntimeThread
|
|
|
|
{
|
2018-05-10 08:37:03 +00:00
|
|
|
readonly Thread thread;
|
|
|
|
|
|
|
|
RuntimeThread (Thread t) { thread = t; }
|
|
|
|
|
|
|
|
public void ResetThreadPoolThread () {}
|
|
|
|
|
|
|
|
public static RuntimeThread InitializeThreadPoolThread () => default;
|
|
|
|
|
|
|
|
public static RuntimeThread Create (ParameterizedThreadStart start, int maxStackSize)
|
|
|
|
=> new RuntimeThread (new Thread (start, maxStackSize));
|
|
|
|
|
|
|
|
public bool IsBackground
|
2018-01-29 19:03:06 +00:00
|
|
|
{
|
2018-05-10 08:37:03 +00:00
|
|
|
get => thread.IsBackground;
|
|
|
|
set => thread.IsBackground = value;
|
2018-01-29 19:03:06 +00:00
|
|
|
}
|
|
|
|
|
2018-05-10 08:37:03 +00:00
|
|
|
public void Start () => thread.Start ();
|
|
|
|
|
|
|
|
public void Start (object state) => thread.Start (state);
|
|
|
|
|
|
|
|
public static bool Yield () => Thread.Yield ();
|
|
|
|
|
|
|
|
public static bool SpinWait (int iterations)
|
2018-01-29 19:03:06 +00:00
|
|
|
{
|
2018-05-10 08:37:03 +00:00
|
|
|
Thread.SpinWait (iterations);
|
|
|
|
return true;
|
2018-01-29 19:03:06 +00:00
|
|
|
}
|
|
|
|
}
|
2017-06-07 13:16:24 +00:00
|
|
|
}
|