Exemple #1
0
 protected static void OnRelease(PTTask task)
 {
     task.initialize = null;
     task.main       = null;
     task.finalize   = null;
     task.period     = 0;
 }
 public PTTask AddTask(PTTimePair timePair, PTTask task)
 {
     task.EndTime = timePair;
     m_tasks.Add(task);
     m_subscriber.Subscribe();
     m_controller.SubscribeFinalizer(timePair);
     return(task);
 }
Exemple #3
0
        public static PTThreadTask Borrow(PTTimePair endTime, PTTask task)
        {
            var ttask = s_pool.Borrow();

            ttask.initialize = task.initialize;
            ttask.main       = task.main;
            ttask.finalize   = task.finalize;
            ttask.EndTime    = endTime;
            return(ttask);
        }
        public bool RemoveTask(PTTask task)
        {
            var index = m_tasks.IndexOf(task);

            if (index < 0)
            {
                return(false);
            }
            RemoveAt(index, false);
            return(true);
        }
Exemple #5
0
 public static void Release(PTTask task)
 {
     task.Release();
 }
Exemple #6
0
 private static void OnRelease(PTThreadTask task)
 {
     PTTask.OnRelease(task);
     task.argument = null;
 }
 public PTTask AddTask(PTTimePair endTime, Func <object> initialize, Func <object, object> main, Action <object> finalize, uint period = 1)
 {
     return(AddTask(endTime, PTTask.Borrow(endTime, initialize, main, finalize, period)));
 }
 public PTTask AddTask(PTTimePair endTime, Func <object, object> main, uint period = 1)
 {
     return(AddTask(endTime, PTTask.Borrow(endTime, null, main, null, period)));
 }
Exemple #9
0
 public static bool RemoveTask(PTTimePair startTime, PTTask task)
 {
     return(PTAddon.Instance.Controller.Tasks[startTime].RemoveTask(task));
 }
Exemple #10
0
 public static PTTask AddTask(PTTimePair startTime, PTTimePair endTime, PTTask task)
 {
     return(PTAddon.Instance.Controller.Tasks[startTime].AddTask(endTime, task));
 }