Lisp HUG Maillist Archive

execute-with-interface

I need to execute several capi interface operations from a test 
function. execute-with-interface appears to return immediately so I 
can't be sure the previous operation completed before starting the next 
one. Is there some way to determine if the function called using 
execute-with-interface (or apply-in-pane-process) has completed?

Thanks,

John DeSoi, Ph.D.


Re: execute-with-interface

Unable to parse email body. Email id is 2496

Re: execute-with-interface

John DeSoi wrote:
> I need to execute several capi interface operations from a test 
> function. execute-with-interface appears to return immediately so I 
> can't be sure the previous operation completed before starting the next 
> one. Is there some way to determine if the function called using 
> execute-with-interface (or apply-in-pane-process) has completed?
> 
> Thanks,
> 
> John DeSoi, Ph.D.
> 
> 
  You could try this,

(defun wait-on-execute-with-interface (interface function &rest args)
   (let ((process mp:*current-process*))
     (capi:execute-with-interface
      interface
      (lambda (args)
        (let ((result (apply function args)))
          (mp:process-interrupt process
                                (lambda ()
                                  (return-from wait-on-execute-with-interface result)))
          result))
      args)
     (mp:process-wait "Wait For EXECUTE-WITH-INTERFACE Completion"
                      (lambda () nil))))

I have not tested it but I pretty sure it will work.

Wade


Updated at: 2020-12-10 08:56 UTC