Can I kill a .NET 4.0 Task object with some method like we could with the old and dangerous Thread.Abort() as discussed in the SO thread (pun intended and save the kittens!)
Kenny
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
Taskclass is designed, and intended, to use the new Cooperative Cancellation model of .NET 4 instead of relying on a destructive “abort” style of cancellation.There is no direct way to cancel a
Task(likeThread.Abort(), though that’s very bad to use in any case), but there is an entire framework in place to provide the tooling to request that the Task cancel itself.