多线程在Java 1.3中实现UncaughtExceptionHandler
如何将一个线程中抛出的异常传递给其调用线程
我不得不使用Java 1.3版Thread.UncaughtExceptionHandler是在Java1.5中添加的
如果我必须将代码包装在一个try块中,从而捕获导致异常的线程中的异常,我会非常高兴。我的问题是如何将这个异常传递给另一个线程
谢谢
你可以在下面搜索框中键入要查询的问题!
如何将一个线程中抛出的异常传递给其调用线程
我不得不使用Java 1.3版Thread.UncaughtExceptionHandler是在Java1.5中添加的
如果我必须将代码包装在一个try块中,从而捕获导致异常的线程中的异常,我会非常高兴。我的问题是如何将这个异常传递给另一个线程
谢谢
# 1 楼答案
向调用线程传递异常可以通过synchronized、wait()和notify()完成