X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=processes.lisp;h=36fa3d952c10e0861386f19b4fa396777cacbc5a;hp=0c9175fc8d8579917071789cf708e4546404be49;hb=7367c68a5daa2ef45c7adf1f4097596f84f5e4dd;hpb=7a31a7ff629ae760d9c3e3abedf6e03605f83f23 diff --git a/processes.lisp b/processes.lisp index 0c9175f..36fa3d9 100644 --- a/processes.lisp +++ b/processes.lisp @@ -7,24 +7,24 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: June 2003 ;;;; -;;;; $Id: processes.lisp,v 1.1 2003/07/08 16:12:40 kevin Exp $ +;;;; $Id$ ;;;; ************************************************************************* (in-package #:kmrcl) (defun make-process (name func) - #+cmu (mp:make-process func :name name) #+allegro (mp:process-run-function name func) + #+cmu (mp:make-process func :name name) #+lispworks (mp:process-run-function name nil func) #+sb-thread (sb-thread:make-thread func) - #+clisp (funcall func) + #-(or allegro cmu lispworks sb-thread) (funcall func) ) (defun destroy-process (process) #+cmu (mp:destroy-process process) #+allegro (mp:process-kill process) - #+sbcl-thread (sb-thread:destroy-thread process) + #+sb-thread (sb-thread:destroy-thread process) #+lispworks (mp:process-kill process) ) @@ -44,6 +44,23 @@ `(mp:with-lock (,lock) ,@body) #+sbcl-thread `(sb-thread:with-recursive-lock (,lock) ,@body) + #-(or allegro cmu lispworks sbcl-thread) + `(progn ,@body) ) +(defmacro with-timeout ((seconds) &body body) + #+allegro + `(mp:with-timeout (,seconds) ,@body) + #+cmu + `(mp:with-timeout (,seconds) ,@body) + #+sbcl-thread + `(sb-ext:with-timeout ,seconds ,@body) + #-(or allegro cmu sbcl-thread) + `(progn ,@body) + ) + +(defun process-sleep (n) + #+allegro (mp:process-sleep n) + #-allegro (sleep n)) +