mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-07 11:28:35 -05:00
Use Scheduler.ThreadPool
This commit is contained in:
@@ -1,30 +1,52 @@
|
||||
namespace UniTask
|
||||
{
|
||||
public class StepScheduler : IScheduler
|
||||
public static partial class Scheduler
|
||||
{
|
||||
LockQueue<TaskChain> m_taskQueue = new LockQueue<TaskChain>();
|
||||
public void Enqueue(TaskChain item)
|
||||
private static StepScheduler mainThread;
|
||||
|
||||
public static StepScheduler MainThread
|
||||
{
|
||||
m_taskQueue.Enqueue(item);
|
||||
get
|
||||
{
|
||||
if (mainThread != null) return mainThread;
|
||||
mainThread = new StepScheduler();
|
||||
MainThreadDispatcher.Initialize();
|
||||
return mainThread;
|
||||
}
|
||||
}
|
||||
|
||||
TaskChain m_chain;
|
||||
public int UpdateAndGetTaskCount()
|
||||
public class StepScheduler : IScheduler
|
||||
{
|
||||
if (m_chain != null)
|
||||
LockQueue<TaskChain> m_taskQueue = new LockQueue<TaskChain>();
|
||||
|
||||
public void Enqueue(TaskChain item)
|
||||
{
|
||||
var status=m_chain.Next();
|
||||
if(status==ExecutionStatus.Continue)
|
||||
{
|
||||
// m_item継続中
|
||||
return m_taskQueue.Count;
|
||||
}
|
||||
m_chain = null;
|
||||
m_taskQueue.Enqueue(item);
|
||||
}
|
||||
|
||||
int count;
|
||||
m_chain = m_taskQueue.Dequeue(out count);
|
||||
return count;
|
||||
TaskChain m_chain;
|
||||
|
||||
public int UpdateAndGetTaskCount()
|
||||
{
|
||||
if (m_chain != null)
|
||||
{
|
||||
var status = m_chain.Next();
|
||||
if (status == ExecutionStatus.Continue)
|
||||
{
|
||||
// m_item継続中
|
||||
return m_taskQueue.Count;
|
||||
}
|
||||
m_chain = null;
|
||||
}
|
||||
|
||||
int count;
|
||||
m_chain = m_taskQueue.Dequeue(out count);
|
||||
return count;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user