I BELIEVE you can also do with lambda expession something like...
Thread t = new Thread(new ThreadStart( () => fail.DoWork(value)));
It took me a while to wrap my head around lambda, but basically what is happening in the above line is this.
Call a function that has no parameters (as a normal call might have). This is represented by the (). The actual definition of the function is what follows the => which does your call with the parameter. This is the same as if you had done the following.
currentMethodStartingTheThread()
{
Thread t = new Thread(new ThreadStart( CallAsParameterized() );
}
void CallAsParameterized()
{
int value = 123;
fail.DoWork(value);
}
Class fail
{
public void DoWork(int Value)
{ do whatever with the parameter value )
}
The only real difference via lambda expression is you do not have to explicitly write the wrapper function with the parameter.