开发者

Impossible to Kill Threads waiting for Interop objects

开发者 https://www.devze.com 2023-01-28 07:52 出处:网络
I\'ve been searching through google a little 开发者_JS百科bit and quite fast discovered that there are no solution on aborting a thread which is using COM Interop and is in a \"wait for interop event\

I've been searching through google a little 开发者_JS百科bit and quite fast discovered that there are no solution on aborting a thread which is using COM Interop and is in a "wait for interop event" state. The Thread.Abort() will just put the thread into "AbortRequested" mode, which, quite franky, isn't much.

The results is me not being able to close my application. The process remains in the taskman because of the a childThread.

Anyone know if it is possible to Force Abort a thread?


Have you tried setting "IsBackground=True" on the thread? Threads marked as background will be cleaned up when the process is exiting, whereas process exit will wait for "foreground" threads.

0

精彩评论

暂无评论...
验证码 换一张
取 消