程序退出时,线程中catch (System.Threading.ThreadAbortException ex)
"unable to evaluate because the code is optimized or a native frame is on top of the call stack."
原因: 是因为线程中有对象因为线程的终止而报的错误. 本例中是因为线程函数中Waitone(),而外部关闭线程,导致异常.
解决方案:关闭线程前,先WaitSet()进行设置,然后再关闭.
"unable to evaluate because the code is optimized or a native frame is on top of the call stack."
原因: 是因为线程中有对象因为线程的终止而报的错误. 本例中是因为线程函数中Waitone(),而外部关闭线程,导致异常.
解决方案:关闭线程前,先WaitSet()进行设置,然后再关闭.