When user aborts a computation, deregister all outstanding thread
authorChris Hanson <org/chris-hanson/cph>
Tue, 23 Feb 1999 21:32:22 +0000 (21:32 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 23 Feb 1999 21:32:22 +0000 (21:32 +0000)
events.

v7/src/runtime/rep.scm
v7/src/runtime/runtime.pkg
v7/src/runtime/thread.scm
v8/src/runtime/runtime.pkg

index 0a9c547cdc9360f283865e1b816d281eb52f629d..6f3a2a008cfd766b174e5cbc54e7f99d7c5903b7 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: rep.scm,v 14.53 1999/02/18 03:54:13 cph Exp $
+$Id: rep.scm,v 14.54 1999/02/23 21:32:22 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -142,6 +142,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                 (loop
                  (bind-abort-restart cmdl
                    (lambda ()
+                     (deregister-thread-events)
                      (with-interrupt-mask interrupt-mask/all
                        (lambda (interrupt-mask)
                          interrupt-mask
index 4950a8a2642bba68efc6dc65ddfd95e1a7cc0615..7fa0830b386b4563a8b47192d5c900e19b98da9f 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.315 1999/02/18 04:01:40 cph Exp $
+$Id: runtime.pkg,v 14.316 1999/02/23 21:31:53 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -3191,6 +3191,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
          create-thread
          create-thread-continuation
          current-thread
+         deregister-all-events
          deregister-input-thread-event
          deregister-timer-event
          detach-thread
index ddc7fe13c9edb4f70d133f14bf2db3367d8b02d7..215b3e9bbe72e722e013b2842bc8910b4b91fb27 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: thread.scm,v 1.24 1999/01/02 06:19:10 cph Exp $
+$Id: thread.scm,v 1.25 1999/02/23 21:31:46 cph Exp $
 
 Copyright (c) 1991-1999 Massachusetts Institute of Technology
 
@@ -770,6 +770,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 (define-integrable (threads-pending-timer-events?)
   timer-records)
 
+(define (deregister-all-events)
+  (let ((thread (current-thread)))
+    (set-interrupt-enables! interrupt-mask/gc-ok)
+    (let ((block-events? (thread/block-events? thread)))
+      (set-thread/block-events?! thread #t)
+      (ring/discard-all (thread/pending-events thread))
+      (%deregister-input-thread-events thread)
+      (%discard-thread-timer-records thread)
+      (set-thread/block-events?! thread block-events?))
+    (set-interrupt-enables! interrupt-mask/all)))
+
 (define (%discard-thread-timer-records thread)
   (let loop ((record timer-records) (prev #f))
     (if record
index a80915e50661dcca5e0d16258bd0a3a9b9b35e78..cd1ca13ec80d6a9653a898a68b0ee02bb614a0c7 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.320 1999/02/18 04:01:31 cph Exp $
+$Id: runtime.pkg,v 14.321 1999/02/23 21:31:59 cph Exp $
 
 Copyright (c) 1988-1999 Massachusetts Institute of Technology
 
@@ -3195,6 +3195,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
          create-thread
          create-thread-continuation
          current-thread
+         deregister-all-events
          deregister-input-thread-event
          deregister-timer-event
          detach-thread