如何取消已执行的任务 [英] How to Cancel an already executed task

查看:121
本文介绍了如何取消已执行的任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的问题是如何取消已执行的任务。假设我有10个任务,我已将这些任务放在基于异步方法的计时器中。由于它是基于计时器的应用程序,因此这些任务将一次又一次地执行。但是,我不希望这种情况发生。如果任务1已经完成,则不应再次执行。



任何人都可以通过一个例子来帮助我。

Hi,

My question is How do you cancel an already executed task. Lets say I have 10 tasks and I have put these tasks in a timer based async method. Since it is a timer based application, these tasks will be executed again and again. But, I don't want this to happen. If Task 1 is already finished then it should not be executed again.

Can anyone help me out in this regard with an example.

推荐答案

请参考此链接:< a href =https://msdn.microsoft.com/en-US/library/7a2f3ay4(v=vs.80).aspx>创建和终止主题


这篇关于如何取消已执行的任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆