我正在尝试使用ThreadPool
,但它给了我错误:
class test
{
public void testMethod1(bool param)
{
var something = !param;
}
public void testMethod2()
{
ThreadPool.QueueUserWorkItem(new WaitCallback(testMethod1), true); //expected a 'void testMethod1(object) signature'
ThreadPool.QueueUserWorkItem(new WaitCallback(testMethod1(true))); //method name is expected
}
}
如何正确使用ThreadPool
?