Reputation: 40756
Currently trying to hunt a potential race condition, I paused my WinForms application in the visual studio debugger.
The Threads window shows a lot of thread which one of them I suspect to be the root cause for the blocking.
I would now love to do the following:
Unfortunately I found no option that would allow me to do something like that.
My question:
Is it possible to kill/terminate a certain thread in the Visual Studio 2013 debugger?
Upvotes: 8
Views: 7347
Reputation: 71
You could simply freeze a thread (Why would you need to exactly kill it?)
Upvotes: 0
Reputation: 913
From Microsoft Technet I found Process Explorer that can solve your problem.
Upvotes: 3
Reputation: 131
It's not easy to just kill a thread because the designers of the language want to avoid the following problem: your thread takes a lock, and then you kill it before it can release it... now anyone who needs that lock will get stuck.
What you have to do is use some global variable to tell the thread to stop. You have to manually, in your thread code, check that global variable and return if you see it indicates you should stop.
Please note that what you are asking is not possible as it stands.
Upvotes: 0