处理线程中的异常 [英] Handling an exception in a thread

查看:79
本文介绍了处理线程中的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个线程进入了调试器。我想切换到它,期待stacktrace,选择重启,等等...该怎么做?

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?

我正在使用 bordeaux -threads

推荐答案

如果使用SLIME,它将自动运行。否则,这取决于您的实现。在SBCL中,(SB-THREAD:RELEASE-FOREGROUND)应该让另一个线程使用该终端。

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.

< a href = http://www.sbcl.org/manual/#Sessions_002fDebugging rel = noreferrer> SBCL手册,12.8会话/调试


在单个会话中,线程在它们之间进行仲裁,以引起用户的注意。线程可能处于三种名义状态之一:前台,后台或已停止。当后台进程尝试打印repl提示符或进入调试器时,它将停止并打印一条消息,指出该进程已停止。闲暇时,用户可以切换到该线程以了解其需求。如果后台线程进入调试器,则选择任何重新启动将在恢复之前将其放回后台。输入流的仲裁是通过调用sb-thread:get-foreground(可能会阻塞)和sb-thread:release-foreground来管理的。

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.

这篇关于处理线程中的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆