What's wrong with using Thread.Abort()

前端 未结 7 1951
执笔经年
执笔经年 2020-11-21 22:30

So I know that you shouldn\'t use

Thread.Abort()

But I\'ve never been given a good explanation. Is there a performance penalty or some hid

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-21 22:51

    Thread.Abort rises an exception in the target thread. Target thread in the meantime can be performing some critical operations and rising an exception can break your application state.

提交回复
热议问题