[trivial-timeout-devel] CCL fix

Milan Jovanovic milanj at gmail.com
Fri Mar 13 10:17:58 UTC 2009


On CCL when timeout is specified and form returns more then one value only
one is returned

CL-USER> (trivial-timeout:with-timeout (1)
           (values 1 2 3))
1
CL-USER>

This fix that
Best,Milan

#+(or digitool openmcl ccl)
(defun generate-platform-specific-code (seconds-symbol doit-symbol)
  (let ((checker-process (format nil "Checker ~S" (gensym)))
   (waiting-process (format nil "Waiter ~S" (gensym)))
   (process (gensym)))
    `(let* ((,process (ccl:process-run-function
           ,checker-process
           (lambda ()
       (progn (,doit-symbol))))))
       (ccl:process-wait-with-timeout
  ,waiting-process
  (* ,seconds-symbol #+(or openmcl ccl)
     ccl:*ticks-per-second* #+digitool 60)
  (lambda ()
    (not (ccl::process-active-p ,process))))
       (when (ccl::process-active-p ,process)
   (ccl:process-kill ,process)
   (cerror "Timeout" 'timeout-error))
       (ccl:join-process ,process))))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/trivial-timeout-devel/attachments/20090313/67b0bba9/attachment.html>


More information about the trivial-timeout-devel mailing list