From cd5ddae98e4ba500d11d0114932ed4585af9326a Mon Sep 17 00:00:00 2001
From: emarsden <emarsden>
Date: Thu, 8 Apr 2004 14:00:03 +0000
Subject: [PATCH] Revert to old behaviour for SERVE-EVENT and reentry of
 handler functions. Don't mask out file descriptors whose handlers are active
 from the set of descriptors that we check for activity.

The possibility for reentry of handler functions is required by Hemlock's
slave lisp mechansism, which uses SERVE-EVENT via the WIRE facility.
---
 code/serve-event.lisp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/code/serve-event.lisp b/code/serve-event.lisp
index e892100b7..0c060b96c 100644
--- a/code/serve-event.lisp
+++ b/code/serve-event.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/serve-event.lisp,v 1.26 2004/03/26 18:22:54 emarsden Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/serve-event.lisp,v 1.27 2004/04/08 14:00:03 emarsden Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -397,6 +397,12 @@
 ;;; Initialize the fd-sets for UNIX-SELECT and return the active descriptor
 ;;; count.
 ;;;
+;;; Ideally we would mask out descriptors whose handler is already
+;;; active, since handler functions may not be reentrant.
+;;; Unfortunately, this would not be compatible with the way that
+;;; Hemlock's slave lisp mechanism interacts with the WIRE facility:
+;;; requests sent to the slave lisp may require a call to the master
+;;; lisp over the same wire. 
 (defmacro calc-masks ()
   '(progn 
      (unix:fd-zero read-fds)
@@ -404,7 +410,7 @@
      (let ((count 0))
        (declare (type index count))
        (dolist (handler *descriptor-handlers*)
-	 (unless (or (handler-active handler)
+	 (unless (or ; (handler-active handler)
 		     (handler-bogus handler))
 	   (let ((fd (handler-descriptor handler)))
 	     (ecase (handler-direction handler)
-- 
GitLab