Xaq*_*ron 5 c# timer try-catch-finally threadabortexception
我有一个System.Timers.Timer定时器,它AutoReset被设置为false.我使用a try/finally来确保Start它的结束时callback的计时器(我使用计时器这种方式来防止重复callback执行).码:
// inside timer call back
try
{
// Do something
}
finally
{
timer.Start(); // Is this line always executed?
}
Run Code Online (Sandbox Code Playgroud)
我的问题是如果执行线程是什么会发生什么Aborted?该finally部分是否仍然执行或者没有线程来运行该部分?
| 归档时间: |
|
| 查看次数: |
1285 次 |
| 最近记录: |