private static IRubyObject raiseBecauseCritical(ThreadContext context) { Ruby runtime = context.runtime; return RubyKernel.raise( context, runtime.getKernel(), new IRubyObject[] { runtime.getThreadError(), runtime.newString("timeout within critical section") }, Block.NULL_BLOCK); }
private static IRubyObject raiseTimeoutError(ThreadContext context, RaiseException re) { Ruby runtime = context.runtime; return RubyKernel.raise( context, runtime.getKernel(), new IRubyObject[] { runtime.getClassFromPath("Timeout::Error"), re.getException().callMethod(context, "message"), re.getException().callMethod(context, "backtrace") }, Block.NULL_BLOCK); }