r7834: remove getopt from package
[kmrcl.git] / processes.lisp
index 64921f7692eda5f84a52b4aa081db4cc5ebe254d..36fa3d952c10e0861386f19b4fa396777cacbc5a 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  June 2003
 ;;;;
-;;;; $Id: processes.lisp,v 1.2 2003/07/09 22:12:52 kevin Exp $
+;;;; $Id$
 ;;;; *************************************************************************
 
 (in-package #:kmrcl)
@@ -24,7 +24,7 @@
 (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)
   )
 
   `(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))
+