Update of /project/net-nittin-irc/cvsroot/net-nittin-irc In directory common-lisp.net:/tmp/cvs-serv25153
Modified Files: protocol.lisp Log Message: separate out start-process for use in programs using cl-irc library Date: Thu Jan 1 03:09:15 2004 Author: krosenberg
Index: net-nittin-irc/protocol.lisp diff -u net-nittin-irc/protocol.lisp:1.32 net-nittin-irc/protocol.lisp:1.33 --- net-nittin-irc/protocol.lisp:1.32 Thu Dec 18 14:43:08 2003 +++ net-nittin-irc/protocol.lisp Thu Jan 1 03:09:15 2004 @@ -1,4 +1,4 @@ -;;;; $Id: protocol.lisp,v 1.32 2003/12/18 19:43:08 krosenberg Exp $ +;;;; $Id: protocol.lisp,v 1.33 2004/01/01 08:09:15 krosenberg Exp $ ;;;; $Source: /project/net-nittin-irc/cvsroot/net-nittin-irc/protocol.lisp,v $
;;;; See LICENSE for licensing information. @@ -121,15 +121,20 @@ (stream-error () (setf read-more-p nil)))))
(defvar *process-count* 0) + +(defmethod start-process (function name) + #+allegro (mp:process-run-function name function) + #+cmu (mp:make-process function :name name) + #+lispworks (mp:process-run-function name nil function) + #+sb-thread (sb-thread:make-thread function)) + (defmethod start-background-message-handler ((connection connection)) "Read messages from the `connection', parse them and dispatch irc-message-event on them. Returns background process ID if available." (flet ((do-loop () (read-message-loop connection))) (let ((name (format nil "irc-hander-~D" (incf *process-count*)))) - #+allegro (mp:process-run-function name #'do-loop) - #+cmu (mp:make-process #'do-loop :name name) - #+lispworks (mp:process-run-function name nil #'do-loop) - #+sb-thread (sb-thread:make-thread #'do-loop) + #+(or allegro cmu lispworks sb-thread) + (start-process #'do-loop name) #+(and sbcl (not sb-thread)) (sb-sys:add-fd-handler (sb-bsd-sockets:socket-file-descriptor (server-socket connection))