本文介绍了在线程池中停止waitcallback的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在事件处理程序内的线程池中为停止"按钮停止waitcallback.我已经搜索了很多,但还没有找到一种方法来做到这一点.请帮忙!

I''m trying to stop a waitcallback in a threadpool within an event handler for a stop button. I''ve searched and searched and have not found a way to do this. Please help!

private void startbutton_Click(object sender, EventArgs e)
{
  WaitCallback doLoadSequential = new WaitCallback this.loadsequential);
  ThreadPool.QueueUserWorkItem(doLoadSequential);
}

private void stopbutton_Click(object sender, EventArgs e)
{

//what goes here?

}

推荐答案


这篇关于在线程池中停止waitcallback的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 19:44