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); }
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); }
public static void Release(PTTask task) { task.Release(); }
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))); }
public static bool RemoveTask(PTTimePair startTime, PTTask task) { return(PTAddon.Instance.Controller.Tasks[startTime].RemoveTask(task)); }
public static PTTask AddTask(PTTimePair startTime, PTTimePair endTime, PTTask task) { return(PTAddon.Instance.Controller.Tasks[startTime].AddTask(endTime, task)); }