c# 启动线程的方式

 

//不带参数的启动方式

scanThread = new Thread(new ThreadStart(startThread));
scanThread.IsBackground = true;
scanThread.Start();

 

//带参数的启动方式

endThread = new Thread(new ParameterizedThreadStart(endThread));
endThread.IsBackground = true;
endThread.Start(param);

 

ThreadPool.QueueUserWorkItem(new WaitCallback(startThread), param);

转载于:https://www.cnblogs.com/ssjsk/p/8891113.html

你可能感兴趣的:(c#)