Esempio n. 1
0
 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));
 }
Esempio n. 2
0
 private TimerChangeEntry(Server.Timer t, int newIndex, bool isAdd)
 {
     this.m_Timer    = t;
     this.m_NewIndex = newIndex;
     this.m_IsAdd    = isAdd;
 }
Esempio n. 3
0
 public static void RemoveTimer(Server.Timer t)
 {
     Server.Timer.TimerThread.Change(t, -1, false);
 }
Esempio n. 4
0
 public static void PriorityChange(Server.Timer t, int newPrio)
 {
     Server.Timer.TimerThread.Change(t, newPrio, false);
 }
Esempio n. 5
0
 public static void Change(Server.Timer t, int newIndex, bool isAdd)
 {
     Server.Timer.TimerThread.m_ChangeQueue.Enqueue(TimerChangeEntry.GetInstance(t, newIndex, isAdd));
 }
Esempio n. 6
0
 public static void AddTimer(Server.Timer t)
 {
     Server.Timer.TimerThread.Change(t, ((int)t.Priority), true);
 }