Hello,

I have some native code that I would like to allow users to interrupt. However, I would like to do it more gracefully than with R_CheckUserInterrupt(). The solution I came up with is to call the following abort function periodically - if it returns 1 then I clean up and return.

int __WINAPI RlpSolveAbortFunction(lprec *lp, void *userhandle)
{
  if(R_interrupts_pending)
    return(1);

  return(0);
}

This seems to work fine on Mac (sans Aqua) and Linux. Is this going to be portable? Also, is there anything else I need to do? For instance set R_interrupts_pending to 0 after I respond to it?

Thanks.
Kjell

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to