예제 #1
0
 public PTThreadPool(int number)
 {
     PTLogger.Info($"Initializing threadpool with {number.ToString()} threads.");
     m_threads = new Thread[number];
     for (var i = 0; i < number; i++)
     {
         m_threads[i] = new Thread(ExecuteTasks);
         m_threads[i].Start();
     }
 }
예제 #2
0
 public static void Flush()
 {
     if (m_sb.Length <= 0)
     {
         return;
     }
     lock (m_lock)
     {
         m_sb.Insert(0, m_logStart);
         PTLogger.Info(m_sb.ToString());
         Clear();
     }
 }