[armedbear-cvs] r13530 - trunk/abcl/src/org/armedbear/lisp

mevenson at common-lisp.net mevenson at common-lisp.net
Mon Aug 22 09:52:29 UTC 2011


Author: mevenson
Date: Mon Aug 22 02:52:28 2011
New Revision: 13530

Log:
All LispThread objects can act on a ProcessingTerminated exception.

Without this modifications, threads created with the
THREADS:MAKE-THREADS cannot successfully call the EXT:QUIT or EXT:EXIT
functions.  This prevented the SLIME quit implementation from
successfully quitting implementations.

Note that all threads can always execute a form like

   (jstatic "exit" "java.lang.System" 0)

to uncermoniously exit the JVM, so there is nothing gained
security-wise by preventing threads from using the official Lisp
interfaces.

Modified:
   trunk/abcl/src/org/armedbear/lisp/LispThread.java

Modified: trunk/abcl/src/org/armedbear/lisp/LispThread.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispThread.java	Sun Aug 21 13:12:11 2011	(r13529)
+++ trunk/abcl/src/org/armedbear/lisp/LispThread.java	Mon Aug 22 02:52:28 2011	(r13530)
@@ -41,6 +41,8 @@
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import java.text.MessageFormat;
+
 public final class LispThread extends LispObject
 {
     static boolean use_fast_calls = false;
@@ -98,10 +100,17 @@
                 catch (ThreadDestroyed ignored) {
                       // Might happen.
                 }
+                catch (ProcessingTerminated e) {
+                    System.exit(e.getStatus());
+                }
                 catch (Throwable t) { // any error: process thread interrupts
                     if (isInterrupted()) {
                         processThreadInterrupts();
                     }
+                    String msg 
+                        = MessageFormat.format("Ignoring uncaught exception {0}.",
+                                               t.toString());
+                    Debug.warn(msg);
                 }
                 finally {
                     // make sure the thread is *always* removed from the hash again




More information about the armedbear-cvs mailing list