From 1cbac61157c5a430760afe743bb69966a8ed3bd4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 23 Feb 1999 21:32:22 +0000 Subject: [PATCH] When user aborts a computation, deregister all outstanding thread events. --- v7/src/runtime/rep.scm | 3 ++- v7/src/runtime/runtime.pkg | 3 ++- v7/src/runtime/thread.scm | 13 ++++++++++++- v8/src/runtime/runtime.pkg | 3 ++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/v7/src/runtime/rep.scm b/v7/src/runtime/rep.scm index 0a9c547cd..6f3a2a008 100644 --- a/v7/src/runtime/rep.scm +++ b/v7/src/runtime/rep.scm @@ -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 diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 4950a8a26..7fa0830b3 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -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 diff --git a/v7/src/runtime/thread.scm b/v7/src/runtime/thread.scm index ddc7fe13c..215b3e9bb 100644 --- a/v7/src/runtime/thread.scm +++ b/v7/src/runtime/thread.scm @@ -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 diff --git a/v8/src/runtime/runtime.pkg b/v8/src/runtime/runtime.pkg index a80915e50..cd1ca13ec 100644 --- a/v8/src/runtime/runtime.pkg +++ b/v8/src/runtime/runtime.pkg @@ -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 -- 2.25.1