首页 > 代码库 > c# 线程启动的两种方式与传参

c# 线程启动的两种方式与传参

1、 

ThreadPool.QueueUserWorkItem(new WaitCallback(writeProgramThread), xoinfo);

 

 

2、

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

不带参数

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

c# 线程启动的两种方式与传参