Jac*_*cob 5 java multithreading
我在Runnable中有以下代码传递给线程t:
public void run() {
logger.debug("Starting thread " + Thread.currentThread());
try {
doStuff();
} catch (Exception e) {
logger.debug("Exception in Thread " + Thread.currentThread());
}
logger.debug("End of thread " + Thread.currentThread());
}
Run Code Online (Sandbox Code Playgroud)
我遇到了一个错误,我发现死锁的情况如下
是否有一些神奇的方式,这个线程可以提前终止,而无需记录线程结束消息或抛出异常?
你确定doStuff()不扔了Error吗?更改catch (Exception e)到catch (Throwable t).用Java杀死线程Thread.stop()是可能的,但这种可能性很小.
| 归档时间: |
|
| 查看次数: |
1294 次 |
| 最近记录: |