Handling an exception in a thread

送分小仙女□ 提交于 2019-12-20 00:55:09

问题


One of my threads entered the debugger. I want to switch to it, expect that stacktrace, choose a restart, etc... How can I do that?

I am using bordeaux-threads.


回答1:


If you use SLIME, it should work automatically. Otherwise it depends on your implementation. In SBCL, (SB-THREAD:RELEASE-FOREGROUND) should let the other thread use the terminal.

SBCL manual, 12.8 Sessions/Debugging

Within a single session, threads arbitrate between themselves for the user's attention. A thread may be in one of three notional states: foreground, background, or stopped. When a background process attempts to print a repl prompt or to enter the debugger, it will stop and print a message saying that it has stopped. The user at his leisure may switch to that thread to find out what it needs. If a background thread enters the debugger, selecting any restart will put it back into the background before it resumes. Arbitration for the input stream is managed by calls to sb-thread:get-foreground (which may block) and sb-thread:release-foreground.



来源:https://stackoverflow.com/questions/41502921/handling-an-exception-in-a-thread

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!