ThreadPool.QueueUserWorkItem with a lambda expression and anonymous method

后端 未结 5 537
慢半拍i
慢半拍i 2020-12-29 03:46

Passing two parameters to a new thread on the threadpool can sometimes be complicated, but it appears that with lambda expressions and anonymous methods, I can do this:

5条回答
  •  一向
    一向 (楼主)
    2020-12-29 04:29

    It's a nice way of doing it. I don't see any disadvantages of using lambdas. It's simple and clean.

提交回复
热议问题