Changeset 12587


Ignore:
Timestamp:
04/09/10 23:10:42 (14 years ago)
Author:
ehuelsmann
Message:

Fix #88: Add the thread name to the debugger-printed message and

bind a restart which allows gracefully exiting a thread.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/LispThread.java

    r12513 r12587  
    7373    private boolean threadInterrupted;
    7474    private LispObject pending = NIL;
     75    private Symbol wrapper =
     76        PACKAGE_THREADS.intern("THREAD-FUNCTION-WRAPPER");
    7577
    7678    LispThread(Thread javaThread)
     
    8688            {
    8789                try {
    88                     funcall(fun, new LispObject[0], LispThread.this);
     90                    funcall(wrapper,
     91                            new LispObject[] { fun },
     92                            LispThread.this);
    8993                }
    9094                catch (ThreadDestroyed ignored) {
  • trunk/abcl/src/org/armedbear/lisp/autoloads.lisp

    r12583 r12587  
    319319(in-package "THREADS")
    320320
    321 
    322 (autoload '(;; Mailbox
     321(autoload '(;; MAKE-THREAD helper
     322            thread-function-wrapper
     323
     324            ;; Mailbox
    323325            make-mailbox mailbox-send mailbox-empty-p
    324326            mailbox-read mailbox-peek
  • trunk/abcl/src/org/armedbear/lisp/debug.lisp

    r12157 r12587  
    9595        (simple-format *debug-io*
    9696                       (if (fboundp 'tpl::repl)
    97                            "Debugger invoked on condition of type ~A:~%"
    98                            "Unhandled condition of type ~A:~%")
     97                           "~S: Debugger invoked on condition of type ~A~%"
     98                           "~S: Unhandled condition of type ~A:~%")
     99                       (threads:current-thread)
    99100                       (type-of condition))
    100101        (simple-format *debug-io* "  ~A~%" condition)))))
  • trunk/abcl/src/org/armedbear/lisp/threads.lisp

    r12213 r12587  
    3333(in-package #:threads)
    3434
     35
     36;;
     37;; MAKE-THREAD helper to establish restarts
     38;;
     39
     40(defun thread-function-wrapper (fun)
     41  (restart-case
     42      (funcall fun)
     43    (abort () :report "Abort thread.")))
    3544
    3645;;
Note: See TracChangeset for help on using the changeset viewer.