コード例 #1
0
ファイル: shared_strand.cs プロジェクト: zhangf911/CsGo
 public void run(int threads = 1)
 {
     _service.reset();
     _service.hold_work();
     _runThreads = new Thread[threads];
     for (int i = 0; i < threads; ++i)
     {
         _runThreads[i] = new Thread(run_thread);
         _runThreads[i].Start();
     }
 }
コード例 #2
0
ファイル: shared_strand.cs プロジェクト: qianc123/CsGo
 public void run(int threads = 1, ThreadPriority priority = ThreadPriority.Normal, bool IsBackground = false)
 {
     _service.reset();
     _service.hold_work();
     _runThreads = new Thread[threads];
     for (int i = 0; i < threads; ++i)
     {
         _runThreads[i]              = new Thread(run_thread);
         _runThreads[i].Priority     = priority;
         _runThreads[i].IsBackground = IsBackground;
         _runThreads[i].Name         = "任务调度";
         _runThreads[i].Start();
     }
 }
コード例 #3
0
 public void run(int threads = 1, ThreadPriority priority = ThreadPriority.Normal, bool background = false, string name = null)
 {
     lock (this)
     {
         Trace.Assert(null == _runThreads, "work_engine 已经运行!");
         _service.reset();
         _service.hold_work();
         _runThreads = new Thread[threads];
         for (int i = 0; i < threads; ++i)
         {
             _runThreads[i]              = new Thread(() => _service.run());
             _runThreads[i].Priority     = priority;
             _runThreads[i].IsBackground = background;
             _runThreads[i].Name         = null == name ? "任务调度" : string.Format("{0}<{1}>", name, i);
             _runThreads[i].Start();
         }
     }
 }