internal static void Init (int _nThreadCount)
{
lock (m_Lock) {
m_nRefCount++;
if (m_nRefCount == 1) {
m_Processes = new MPCList<dLightWeightProcessBase> ();
ThreadProcess.Init ();
m_Threads = new List<Thread> ();
int nThreadCount = _nThreadCount;
for (int i = 0; i < nThreadCount; i++) {
Thread thread = new Thread (delegate () { ThreadProcess process = new ThreadProcess (); process.MainLoop (); });
thread.Name = String.Format ("dLightWeightProcessThread_{0}", i);
thread.Start ();
m_Threads.Add (thread);
}
}
}
}