Ticket #86: thread-restarts.patch
File thread-restarts.patch, 2.6 KB (added by , 13 years ago) |
---|
-
src/org/armedbear/lisp/autoloads.lisp
318 318 319 319 (in-package "THREADS") 320 320 321 (autoload '(;; MAKE-THREAD helper 322 thread-function-wrapper 321 323 322 (autoload '(;; Mailbox324 ;; Mailbox 323 325 make-mailbox mailbox-send mailbox-empty-p 324 326 mailbox-read mailbox-peek 325 327 -
src/org/armedbear/lisp/debug.lisp
94 94 (stream-offset *load-stream*))) 95 95 (simple-format *debug-io* 96 96 (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) 99 100 (type-of condition)) 100 101 (simple-format *debug-io* " ~A~%" condition))))) 101 102 -
src/org/armedbear/lisp/LispThread.java
72 72 public LispObject[] _values; 73 73 private boolean threadInterrupted; 74 74 private LispObject pending = NIL; 75 private Symbol wrapper = 76 PACKAGE_THREADS.intern("THREAD-FUNCTION-WRAPPER"); 75 77 76 78 LispThread(Thread javaThread) 77 79 { … … 85 87 public void run() 86 88 { 87 89 try { 88 funcall(fun, new LispObject[0], LispThread.this); 90 funcall(wrapper, 91 new LispObject[] { fun }, 92 LispThread.this); 89 93 } 90 94 catch (ThreadDestroyed ignored) { 91 95 // Might happen. -
src/org/armedbear/lisp/threads.lisp
34 34 35 35 36 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."))) 44 45 ;; 37 46 ;; Mailbox implementation 38 47 ;; 39 48