public void Start()
{
lock (syncRoot)
{
if (workThread != null)
return;
cts = new CancellationTokenSource();
workThread = new Thread(WorkThread)
{
Name = GetType().Name + " : " + Gpu.Id,
IsBackground = true,
Priority = ThreadPriority.Lowest,
};
workThread.Start();
}
}
/// <summary> /// Invoked by the host to begin a new miner. /// </summary> /// <param name="context"></param> /// <param name="resource"></param> /// <returns></returns> public IMiner StartMiner(IMinerContext context, MinerResource resource) { var miner = new GpuMiner(context, (GpuResource)resource); miner.Start(); return miner; }