private LinkedListNode <ISuperInvokeRunnable> GetPoolNode(ISuperInvokeRunnable value) { var node = SuperInvokePoolHolder.PoolManager.GetInstance <LinkedListNode <ISuperInvokeRunnable> >(); node.Value = value; return(node); }
private void ReschedulingAfterExecution() { for (LinkedListNode <ISuperInvokeRunnable> node = executionQueue.First; node != null; node = node.Next) { ISuperInvokeRunnable runnable = node.Value; if (runnable.NoMoreTasks()) { if (runnable.GetJobState() != JobState.Killed) { runnable.Complete(); } runnable.RemovedFromScheduler(); //ended } else if (killAfterExecutionBag.Contains(runnable)) { runnable.RemovedFromScheduler(); //killed } else if (pauseAfterExecutionBag.Contains(runnable)) { pauseQueue.AddLast(runnable); //paused } else { scheduleQueue.AddLast(runnable); } } killAfterExecutionBag.Clear(); pauseAfterExecutionBag.Clear(); }
internal void ScheduleTask(ISuperInvokeRunnable superInvokeRunnable) { if (superInvokeRunnable is Sequence) { ((Sequence)superInvokeRunnable).AddedToScheduler(); } superInvokeRunnable.SetTriggerTime(SystemTime.Current); scheduleQueue.AddLast(GetPoolNode(superInvokeRunnable)); }
private static IJob ActualRun(Action method, float delay, string tag) { CheckMethod(method); CheckDelay(delay); Job job = new Job(); ISuperInvokeRunnable runnable = SingleTask.MakeInstance(method, delay, tag); runnable.SetJob(job); ScheduleBridge.Schedule(runnable); return(job); }
private bool HasAnyOfTheseTags(ISuperInvokeRunnable runnable, SuperInvokeTag[] tags) { bool hasAnyOfTheseTags = false; int i = 0; while (i < tags.Length && !hasAnyOfTheseTags) { hasAnyOfTheseTags = runnable.HasThisTag(tags[i]); i++; } return(hasAnyOfTheseTags); }
internal static void Schedule(ISuperInvokeRunnable runnable) { GrabManager(); superInvokeManager.ScheduleTask(runnable); }