4
对不起,如果这之前已被问过,但我想简要回答以下两种用法之间的差异。 VS似乎接受他们两人作为有效的代码。new Thread(void Target())和new Thread(new ThreadStart(void Target()))有什么区别?
private static void doSomeWork()
{
//do some work
}
public someClass()
{
//Thread thread = new Thread(doSomeWork);
//or
//Thread thread = new Thread(new ThreadStart(doSomeWork));
}
看看http://stackoverflow.com/questions/3360555/how-to-pass-parameters-to-threadstart-method-in-thread –
非常相似:http://stackoverflow.com/questions/2749868/new-eventhandlermethod-vs-method – CodesInChaos
[C#Delegate Instantiation vs. Just Passing the Method Reference]可能的重复(http://stackoverflow.com/questions/2181282/c-sharp-delegate-instantiation-vs-just -passing-the-method-reference) – nawfal