Navigation Menu

Skip to content

Commit

Permalink
fixes for Thread#abort_on_exception and Thread.abort_on_exception
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@2068 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information
headius committed Jun 14, 2006
1 parent 54594cf commit 6091277
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/org/jruby/RubyThread.java
Expand Up @@ -88,9 +88,9 @@ public static RubyClass createThreadClass(IRuby runtime) {
threadClass.defineMethod("[]=",
callbackFactory.getMethod("aset", IRubyObject.class, IRubyObject.class));
threadClass.defineMethod("abort_on_exception",
callbackFactory.getMethod("abort_on_exception", IRubyObject.class));
callbackFactory.getMethod("abort_on_exception"));
threadClass.defineMethod("abort_on_exception=",
callbackFactory.getMethod("abort_on_exception_set", IRubyObject.class, IRubyObject.class));
callbackFactory.getMethod("abort_on_exception_set", IRubyObject.class));
threadClass.defineMethod("alive?",
callbackFactory.getMethod("is_alive"));
threadClass.defineMethod("group",
Expand Down Expand Up @@ -140,6 +140,10 @@ public static RubyClass createThreadClass(IRuby runtime) {
callbackFactory.getSingletonMethod("s_kill", RubyThread.class));
threadClass.defineSingletonMethod("exit",
callbackFactory.getSingletonMethod("s_exit"));
threadClass.defineSingletonMethod("abort_on_exception",
callbackFactory.getSingletonMethod("abort_on_exception"));
threadClass.defineSingletonMethod("abort_on_exception=",
callbackFactory.getSingletonMethod("abort_on_exception_set", IRubyObject.class));

RubyThread rubyThread = new RubyThread(runtime, threadClass);
// set hasStarted to true, otherwise Thread.main.status freezes
Expand Down Expand Up @@ -280,8 +284,11 @@ public void pollThreadEvents() {

private void pollReceivedExceptions() {
if (receivedException != null) {
// clear this so we don't keep re-throwing
IRubyObject raiseException = receivedException;
receivedException = null;
RubyModule kernelModule = getRuntime().getModule("Kernel");
kernelModule.callMethod("raise", receivedException);
kernelModule.callMethod("raise", raiseException);
}
}

Expand Down

0 comments on commit 6091277

Please sign in to comment.