コード例 #1
0
        private void InitThread(ClientAsyncActionProcessor asyncActionQueue)
        {
#if !PLATFORM_WEBGL
            m_Thread = new Thread(this.Loop);
#else
            m_Thread = new Thread(CustomThreadLoop);
#endif
            m_ActionQueue = asyncActionQueue;
        }
コード例 #2
0
 private void InitTaskThreads(int threadNum, bool isPassive)
 {
     if (isPassive)
     {
         m_ActionQueue = new ClientAsyncActionProcessor();
     }
     m_Threads = new MyClientThread[threadNum];
     for (int i = 0; i < threadNum; ++i)
     {
         MyClientThread thread = null;
         if (isPassive)
         {
             thread = new MyClientThread(m_ActionQueue);//线程主动取策略
         }
         else
         {
             thread = new MyClientThread();//dispatcher主动推策略
         }
         m_Threads[i] = thread;
         thread.Start();
     }
 }
コード例 #3
0
 public MyClientThread(int tickSleepTime, int actionNumPerTick, ClientAsyncActionProcessor asyncActionQueue)
 {
     m_TickSleepTime    = tickSleepTime;
     m_ActionNumPerTick = actionNumPerTick;
     InitThread(asyncActionQueue);
 }
コード例 #4
0
 public MyClientThread(int tickSleepTime, ClientAsyncActionProcessor asyncActionQueue)
 {
     m_TickSleepTime = tickSleepTime;
     InitThread(asyncActionQueue);
 }
コード例 #5
0
 private void InitThread(ClientAsyncActionProcessor asyncActionQueue)
 {
     m_Thread      = new Thread(this.Loop);
     m_ActionQueue = asyncActionQueue;
 }
コード例 #6
0
 public MyClientThread(ClientAsyncActionProcessor asyncActionQueue)
 {
     InitThread(asyncActionQueue);
 }