Ejemplo n.º 1
0
  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);
  }
Ejemplo n.º 2
0
  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);
  }