/[slime]/slime/swank-backend.lisp
ViewVC logotype

Diff of /slime/swank-backend.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by heller, Tue Jan 13 18:16:37 2004 UTC revision 1.17 by lgorrie, Thu Jan 15 11:42:12 2004 UTC
# Line 112  a stream for the new connection.")) Line 112  a stream for the new connection."))
112  (defgeneric add-input-handler (socket fn)  (defgeneric add-input-handler (socket fn)
113    (:documentation "Call FN whenever SOCKET is readable."))    (:documentation "Call FN whenever SOCKET is readable."))
114    
 (defgeneric spawn (fn &key name)  
   (:documentation "Create a new process and call FN in the new process."))  
   
115  ;;; Base condition for networking errors.  ;;; Base condition for networking errors.
116  (define-condition network-error (error) ())  (define-condition network-error (error) ())
117    
# Line 157  positions reported in compiler condition Line 154  positions reported in compiler condition
154     "Compile FILENAME signalling COMPILE-CONDITIONs.     "Compile FILENAME signalling COMPILE-CONDITIONs.
155  If LOAD-P is true, load the file after compilation."))  If LOAD-P is true, load the file after compilation."))
156    
 ;;;;; Compiler conditions  
   
157  (deftype severity () '(member :error :warning :style-warning :note))  (deftype severity () '(member :error :warning :style-warning :note))
158    
159  ;; Base condition type for compiler errors, warnings and notes.  ;; Base condition type for compiler errors, warnings and notes.
# Line 180  If LOAD-P is true, load the file after c Line 175  If LOAD-P is true, load the file after c
175     (location :initarg :location     (location :initarg :location
176               :accessor location)))               :accessor location)))
177    
178  ;;;  
179  ;;;; Streams  ;;;; Streams
180    
181  (defgeneric make-fn-streams (input-fn output-fn)  (defgeneric make-fn-streams (input-fn output-fn)
# Line 397  from Emacs. This is to support interface Line 392  from Emacs. This is to support interface
392  MP::STARTUP-IDLE-AND-TOP-LEVEL-LOOPS which does not return like a  MP::STARTUP-IDLE-AND-TOP-LEVEL-LOOPS which does not return like a
393  normal function."))  normal function."))
394    
395    (defgeneric spawn (fn &key name)
396      (:documentation "Create a new thread to call FN."))
397    
398  (defgeneric thread-id ()  (defgeneric thread-id ()
399    (:documentation    (:documentation
400     "Return a value that uniquely identifies the current thread.     "Return a value that uniquely identifies the current thread.
# Line 418  Systems that do not support multiprocess Line 416  Systems that do not support multiprocess
416  Thread names are be single-line strings and are meaningful to the  Thread names are be single-line strings and are meaningful to the
417  user. They do not have to be unique."))  user. They do not have to be unique."))
418    
419  (defgeneric call-with-I/O-lock (function)  (defgeneric make-lock (&key name)
420    (:documentation    (:documentation
421     "Call FUNCTION with the \"I/O\" lock held.     "Make a lock for thread synchronization.
422  Only one thread can hold the I/O lock at a time -- others are blocked  Only one thread may hold the lock (via CALL-WITH-LOCK-HELD) at a time."))
 until they acquire it. When called recursively (i.e. lock already  
 held), simply calls FUNCTION.  
   
 This is a low-level lock used for mutual exclusion on individual  
 messages read and written to the socket connecting Emacs.  
423    
424  Systems that do not support multiprocessing simply call FUNCTION."))  (defgeneric call-with-lock-held (lock function)
   
 (defgeneric call-with-conversation-lock (function)  
425    (:documentation    (:documentation
426     "Call FUNCTION with the \"conversation\" lock held.     "Call FUNCTION with LOCK held, queueing if necessary."))
 The semantics are analogous to CALL-WITH-I/O-HOOK.  
   
 This is a high-level lock used for mutual exclusion in conversations  
 with Emacs that can span multiple messages. The I/O lock must  
 separately be held when reading and writing individual messages."))  
   
 ;;; Functions for attracting the Emacs user's attention.  
   
 (defgeneric wait-goahead ()  
   (:documentation  
    "Block until told to continue by `give-gohead'.  
   
 Systems that do not support multiprocessing return immediately."))  
   
 (defgeneric give-goahead (thread-id)  
   (:documentation  
    "Permit THREAD-ID to continue from WAIT-GOAHEAD.  
 It is an error to call (GIVE-GOAHEAD ID) unless ID is blocking in  
 WAIT-GOAHEAD.  
   
 Systems that do not support multiprocessing always signal an error."))  
427    
428    
429  ;;;;; Default implementation for non-MP systems  ;;;;; Default implementation for non-MP systems
# Line 471  Systems that do not support multiprocess Line 441  Systems that do not support multiprocess
441  (defmethod no-applicable-method ((m (eql #'thread-name)) &rest _)  (defmethod no-applicable-method ((m (eql #'thread-name)) &rest _)
442    (declare (ignore _))    (declare (ignore _))
443    "The One True Thread")    "The One True Thread")
444  (defmethod no-applicable-method ((m (eql #'call-with-I/O-lock))  (defmethod no-applicable-method ((m (eql #'make-lock)) &rest _)
                                  &rest args)  
   (funcall (first args)))  
 (defmethod no-applicable-method ((m (eql #'call-with-conversation-lock))  
                                  &rest args)  
   (funcall (first args)))  
 (defmethod no-applicable-method ((m (eql #'wait-goahead)) &rest _)  
   (declare (ignore _))  
   t)  
 (defmethod no-applicable-method ((m (eql #'give-goahead)) &rest _)  
445    (declare (ignore _))    (declare (ignore _))
446    (error "SLIME multiprocessing not available"))    :null-lock)
447    (defmethod no-applicable-method ((m (eql #'call-with-lock-held)) &rest args)
448      (funcall (second args)))
449    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.5