public RuntimeInvokeResult RuntimeInvoke(Thread thread,
TargetFunctionType function,
TargetStructObject object_argument,
TargetObject[] param_objects,
RuntimeInvokeFlags flags)
{
IInterruptionHandler interruption = InterruptionHandler ?? Interpreter;
if (interruption.CheckInterruption ())
throw new EvaluationTimeoutException ();
RuntimeInvokeResult result = thread.RuntimeInvoke (
function, object_argument, param_objects, flags);
WaitHandle[] handles = new WaitHandle [2];
handles [0] = interruption.InterruptionEvent;
handles [1] = result.CompletedEvent;
int ret = WaitHandle.WaitAny (handles);
if (ret == 0) {
result.Abort ();
throw new EvaluationTimeoutException ();
}
return result;
}