Runnable timeoutRunnable = new Runnable() {
public void run() {
if (latch.compareAndSet(false, true)) {
if (currentThread.alive_p().isTrue()) {
RubyClass anonException = (RubyClass)runtime.getClassFromPath("Timeout::AnonymousException");
IRubyObject anonExceptionObj = anonException.newInstance(runtime.getCurrentContext(), runtime.newString("execution expired"), Block.NULL_BLOCK);
anonExceptionObj.getInternalVariables().setInternalVariable("__identifier__", id);
currentThread.internalRaise(new IRubyObject[] {anonExceptionObj});
}
}
}