Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why there is no class like ParameterizedThreadStart<T>?

The class ParameterizedThreadStart, always takes object as parameter. Which I suppose was introduced in .Net 1.0/1.1

But after generics was introduced, I am expecting a class like ParameterizedThreadStart<T>, which is still not there?

Was it missed? or Is there any other reason?

like image 868
NileshChauhan Avatar asked Jun 12 '11 12:06

NileshChauhan


1 Answers

The easy workaround is to use lambdas/anonymous functions to capture local variables and then use the unparameterized threadstart.

ThreadStart start = () => func(param1, param2)
like image 101
CodesInChaos Avatar answered Sep 25 '22 19:09

CodesInChaos