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

Diff of /slime/swank.lisp

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

revision 1.798 by sboukarev, Tue Nov 13 15:44:40 2012 UTC revision 1.799 by heller, Sun Dec 16 13:38:21 2012 UTC
# Line 997  The processing is done in the extent of Line 997  The processing is done in the extent of
997     (force-output stream)     (force-output stream)
998     (sleep *auto-flush-interval*)))     (sleep *auto-flush-interval*)))
999    
1000  ;; FIXME: drop dependency on find-repl-thread  (defgeneric thread-for-evaluation (connection id)
1001  (defun thread-for-evaluation (connection id &key find-existing)    (:documentation "Find or create a thread to evaluate the next request.")
1002    "Find or create a thread to evaluate the next request."    (:method ((connection multithreaded-connection) (id (eql t)))
1003    (etypecase id      (spawn-worker-thread connection))
1004      ((member t)    (:method ((connection multithreaded-connection) (id (eql :find-existing)))
1005       (etypecase connection      (car (mconn.active-threads connection)))
1006         (multithreaded-connection    (:method (connection (id fixnum))
1007          (if find-existing      (find-thread id))
1008              (or (car (mconn.active-threads connection))    (:method ((connection singlethreaded-connection) id)
1009                  (find-repl-thread connection))      (current-thread)))
             (spawn-worker-thread connection)))  
        (singlethreaded-connection (current-thread))))  
     ((member :repl-thread)  
      (find-repl-thread connection))  
     (fixnum  
      (find-thread id))))  
1010    
1011  (defun interrupt-worker-thread (connection id)  (defun interrupt-worker-thread (connection id)
1012    (let ((thread (thread-for-evaluation connection id    (let ((thread (thread-for-evaluation connection
1013                                         :find-existing t)))                                         (cond ((eq id t) :find-existing)
1014                                                 (t id)))))
1015      (log-event "interrupt-worker-thread: ~a ~a~%" id thread)      (log-event "interrupt-worker-thread: ~a ~a~%" id thread)
1016      (if thread      (if thread
1017          (etypecase connection          (etypecase connection

Legend:
Removed from v.1.798  
changed lines
  Added in v.1.799

  ViewVC Help
Powered by ViewVC 1.1.5