ThreadPool.QueueUserWorkItemdelegate required WaitCallbackas an argument.
This delegate type corresponds to the function of a voidsingle type argument Object.
So the full version of the call can be
ThreadPool.QueueUserWorkItem(
new WaitCallback(delegate(object state) { test.DoWork(s1,s2); });
);
Will be more concise
ThreadPool.QueueUserWorkItem(
delegate(object state) { test.DoWork(s1,s2); };
);
Using C # 3.0 syntax, we can write it in shorter form:
ThreadPool.QueueUserWorkItem(
(object state) => { test.DoWork(s1,s2); };
);
# 3.0 - state. , .