[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Sat Dec 10 12:34:09 UTC 2011


Update of /project/slime/cvsroot/slime
In directory tiger.common-lisp.net:/tmp/cvs-serv29737

Modified Files:
	ChangeLog swank-backend.lisp swank.lisp 
Log Message:
* swank.lisp (auto-flush-loop): Don't use call-with-io-timeout.
Removing it had no effect on the number of failed tests.  If you
want it back, first create a test case to demonstrate the problem.
* swank-backend.lisp: Mention that locks should only be used in
swank-gray.lisp.

--- /project/slime/cvsroot/slime/ChangeLog	2011/12/10 12:33:52	1.2284
+++ /project/slime/cvsroot/slime/ChangeLog	2011/12/10 12:34:09	1.2285
@@ -1,5 +1,13 @@
 2011-12-10  Helmut Eller  <heller at common-lisp.net>
 
+	* swank.lisp (auto-flush-loop): Don't use call-with-io-timeout.
+	Removing it had no effect on the number of failed tests.  If you
+	want it back, first create a test case to demonstrate the problem.
+	* swank-backend.lisp: Mention that locks should only be used in
+	swank-gray.lisp.
+
+2011-12-10  Helmut Eller  <heller at common-lisp.net>
+
 	* swank.lisp: Move global io-redirection contrib/slime-repl.lisp.
 
 2011-12-10  Helmut Eller  <heller at common-lisp.net>
--- /project/slime/cvsroot/slime/swank-backend.lisp	2011/12/01 22:34:41	1.214
+++ /project/slime/cvsroot/slime/swank-backend.lisp	2011/12/10 12:34:09	1.215
@@ -430,6 +430,16 @@
   "Convert the (simple-array (unsigned-byte 8)) OCTETS to a string."
   (default-utf8-to-string octets))
 
+;;; Codepoint length
+
+;; we don't need this anymore.
+(definterface codepoint-length (string)
+  "Return the number of codepoints in STRING.
+With some Lisps, like cmucl, LENGTH returns the number of UTF-16 code
+units, but other Lisps return the number of codepoints. The slime
+protocol wants string lengths in terms of codepoints."
+  (length string))
+
 
 ;;;; TCP server
 
@@ -1086,9 +1096,10 @@
   (make-error-location "FIND-DEFINITIONS is not yet implemented on ~
                         this implementation."))
 
-
 (definterface buffer-first-change (filename)
-  "Called for effect the first time FILENAME's buffer is modified."
+  "Called for effect the first time FILENAME's buffer is modified.
+CMUCL/SBCL use this to cache the unmodified file and use the
+unmodified text to improve the precision of source locations."
   (declare (ignore filename))
   nil)
 
@@ -1191,6 +1202,19 @@
 themselves, that is, their dispatch functions, are left alone.")
 
 
+;;;; Trace
+
+(definterface toggle-trace (spec)
+  "Toggle tracing of the function(s) given with SPEC.
+SPEC can be:
+ (setf NAME)                            ; a setf function
+ (:defmethod NAME QUALIFIER... (SPECIALIZER...)) ; a specific method
+ (:defgeneric NAME)                     ; a generic function with all methods
+ (:call CALLER CALLEE)                  ; trace calls from CALLER to CALLEE.
+ (:labels TOPLEVEL LOCAL) 
+ (:flet TOPLEVEL LOCAL) ")
+
+
 ;;;; Inspector
 
 (defgeneric emacs-inspect (object)
@@ -1293,19 +1317,6 @@
   (declare (ignore thread))
   '())
 
-(definterface make-lock (&key name)
-   "Make a lock for thread synchronization.
-Only one thread may hold the lock (via CALL-WITH-LOCK-HELD) at a time
-but that thread may hold it more than once."
-   (declare (ignore name))
-   :null-lock)
-
-(definterface call-with-lock-held (lock function)
-   "Call FUNCTION with LOCK held, queueing if necessary."
-   (declare (ignore lock)
-            (type function function))
-   (funcall function))
-
 (definterface current-thread ()
   "Return the currently executing thread."
   0)
@@ -1377,15 +1388,30 @@
 
 Return :interrupt if an interrupt occurs while waiting.")
 
-(definterface toggle-trace (spec)
-  "Toggle tracing of the function(s) given with SPEC.
-SPEC can be:
- (setf NAME)                            ; a setf function
- (:defmethod NAME QUALIFIER... (SPECIALIZER...)) ; a specific method
- (:defgeneric NAME)                     ; a generic function with all methods
- (:call CALLER CALLEE)                  ; trace calls from CALLER to CALLEE.
- (:labels TOPLEVEL LOCAL) 
- (:flet TOPLEVEL LOCAL) ")
+
+;;;;  Locks 
+
+;; Please use locks only in swank-gray.lisp.  Locks are too low-level
+;; for our taste.
+
+(definterface make-lock (&key name)
+   "Make a lock for thread synchronization.
+Only one thread may hold the lock (via CALL-WITH-LOCK-HELD) at a time
+but that thread may hold it more than once."
+   (declare (ignore name))
+   :null-lock)
+
+(definterface call-with-lock-held (lock function)
+   "Call FUNCTION with LOCK held, queueing if necessary."
+   (declare (ignore lock)
+            (type function function))
+   (funcall function))
+
+;; Same here: don't use this outside of swank-gray.lisp.
+(definterface call-with-io-timeout (function &key seconds)
+  "Calls function with the specified IO timeout."
+  (declare (ignore seconds))
+  (funcall function))
 
 
 ;;;; Weak datastructures
@@ -1460,19 +1486,3 @@
   "Request saving a heap image to the file FILENAME.
 RESTART-FUNCTION, if non-nil, should be called when the image is loaded.
 COMPLETION-FUNCTION, if non-nil, should be called after saving the image.")
-
-;;; Codepoint length
-
-(definterface codepoint-length (string)
-  "Return the number of codepoints in STRING.
-With some Lisps, like cmucl, LENGTH returns the number of UTF-16 code
-units, but other Lisps return the number of codepoints. The slime
-protocol wants string lengths in terms of codepoints."
-  (length string))
-
-;;; Timeouts
-
-(definterface call-with-io-timeout (function &key seconds)
-  "Calls function with the specified IO timeout."
-  (declare (ignore seconds))
-  (funcall function))
--- /project/slime/cvsroot/slime/swank.lisp	2011/12/10 12:33:52	1.779
+++ /project/slime/cvsroot/slime/swank.lisp	2011/12/10 12:34:09	1.780
@@ -941,15 +941,11 @@
 
 (defun auto-flush-loop (stream)
   (loop
-    (when (not (and (open-stream-p stream) 
-                    (output-stream-p stream)))
-      (return nil))
-    ;; Use an IO timeout to avoid deadlocks
-    ;; on the stream we're flushing.
-    (call-with-io-timeout
-     (lambda () (finish-output stream))
-     :seconds 0.1)
-    (sleep *auto-flush-interval*)))
+   (when (not (and (open-stream-p stream)
+                   (output-stream-p stream)))
+     (return nil))
+   (force-output stream)
+   (sleep *auto-flush-interval*)))
 
 ;; FIXME: drop dependency on find-repl-thread
 (defun find-worker-thread (connection id)





More information about the slime-cvs mailing list