In a great answer about starting the timer immediately , I could see the following code:
timer.Elapsed += timer_Elapsed; ThreadPool.QueueUserWorkItem((_) => DoWork()); ... void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { DoWork(); } void DoWork() {
I tried this myself and I came across this line where, as I thought, there was a typo in the delegate's anonymous construct:
What? | V ThreadPool.QueueUserWorkItem((_) => DoWork());
What hidden rule makes the underscore "_" acceptable as the parameter name in anonymous deletes?
Larry source share