public static Server.Timer.TimerThread.TimerChangeEntry GetInstance(Server.Timer t, int newIndex, bool isAdd) { Server.Timer.TimerThread.TimerChangeEntry entry1; if (Server.Timer.TimerThread.TimerChangeEntry.m_InstancePool.Count > 0) { entry1 = ((Server.Timer.TimerThread.TimerChangeEntry)Server.Timer.TimerThread.TimerChangeEntry.m_InstancePool.Dequeue()); entry1.m_Timer = t; entry1.m_NewIndex = newIndex; entry1.m_IsAdd = isAdd; return(entry1); } return(new Server.Timer.TimerThread.TimerChangeEntry(t, newIndex, isAdd)); }
private TimerChangeEntry(Server.Timer t, int newIndex, bool isAdd) { this.m_Timer = t; this.m_NewIndex = newIndex; this.m_IsAdd = isAdd; }
public static void RemoveTimer(Server.Timer t) { Server.Timer.TimerThread.Change(t, -1, false); }
public static void PriorityChange(Server.Timer t, int newPrio) { Server.Timer.TimerThread.Change(t, newPrio, false); }
public static void Change(Server.Timer t, int newIndex, bool isAdd) { Server.Timer.TimerThread.m_ChangeQueue.Enqueue(TimerChangeEntry.GetInstance(t, newIndex, isAdd)); }
public static void AddTimer(Server.Timer t) { Server.Timer.TimerThread.Change(t, ((int)t.Priority), true); }