本文介绍了不同线程上的异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
公用静态void OpenSplashScreen() { 尝试 fSplash 新 fSplash. LoginSucceeded + =新的EventHandler(fSplash_LoginSucceeded); ThreadPool.QueueUserWorkItem(new WaaCallback(fSplash.Start)); { ;'',ExceptionType.UnexceptedException,ExceptionSeverity.Error,null,","ex");
解决方案 I don't think that is how exception in thread work. When you spawn a thread it has its own unique call stack. When a thread occurs in that thread it will bubble up that thread's call stack until it reaches the top. At that point if un-handled that thread will terminate.That exception won't be marshaled back to the main thread which spawned the thread with the exception.
本文标签:线程 异常
嘿! 我正在像这样使用ThreadPool
public static void OpenSplashScreen() |
{ |
frmSplashScreen fSplash; |
try |
{ |
fSplash = new frmSplashScreen(); |
fSplash.LoginSucceeded += new EventHandler(fSplash_LoginSucceeded); |
ThreadPool.QueueUserWorkItem(new WaitCallback(fSplash.Start)); |
} |
catch (Exception ex) |
{ |
throw new ExceptionHandler("", ExceptionType.UnexceptedException, ExceptionSeverity.Error, null, "", ex); |
} |
} |
更多推荐
不同线程上的异常?
本文发布于:2023-11-12 12:21:50,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
发布评论