I have to run some piece of code as a separate thread on ThreadPool.
ThreadPool.QueueUserWorkItem(MyMethod,MyObjects);
I need to run another method MyMethod2 once MyMethod is completed. How can I do that?
Here's a way to do it:
ThreadPool.QueueUserWorkItem(o => { MyMethod(o); MyOtherMethod(); }, MyObjects);
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