有什么方法可以在没有cancelPending的情况下停止backgroundWorker线程?我有这样的代码:
DoWorkFunction
{
if(worker.cancellationPending == true) return; //this works great but
VeryLongTimeComputingFunc();//this function take a lot of time and if it starts i can't stop it with cancellationPending
...Do something
}
即使它启动了VeryLongTimeComputingFunc(),有什么方法可以阻止工人吗?