Can somebody please clarify why we use ThreadStart?
new Thread (new ThreadStart (Update)).Start(); -Versus-
new Thread (Update).Start(); // Seems more straightforward
private void Update() { }
Can somebody please clarify why we use ThreadStart?
You don't have to. If you do, only you can say why...
Since C# 2, method groups (i.e. references to a method via its name) are implicitly convertible to delegates with the same signature. Since the Thread
constructor takes a ThreadStart
, you can pass it a method group with the same signature as ThreadStart
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With