Permalink
Browse files

Add 1.9's Thread#backtrace (JRUBY-4761)

  • Loading branch information...
1 parent 829cd0a commit 854f2558ae4bb0571e7ddc814ef7d67b983452bc @headius headius committed Apr 27, 2010
Showing with 5 additions and 11 deletions.
  1. +5 −11 src/org/jruby/RubyThread.java
@@ -788,17 +788,6 @@ public IRubyObject kill() {
getRuntime().getThreadService().deliverEvent(new ThreadService.Event(currentThread, this, ThreadService.Event.Type.KILL));
if (DEBUG) System.out.println("thread " + Thread.currentThread() + " succeeded with kill");
-
- // FIXME: is this still necessary?
-// try {
-// threadImpl.join();
-// } catch (InterruptedException ie) {
-// // we were interrupted, check thread events again
-// currentThread.pollThreadEvents();
-// } catch (ExecutionException ie) {
-// // we were interrupted, check thread events again
-// currentThread.pollThreadEvents();
-// }
return this;
}
@@ -813,6 +802,11 @@ public IRubyObject safe_level() {
throw getRuntime().newNotImplementedError("Thread-specific SAFE levels are not supported");
}
+ @JRubyMethod(compat = CompatVersion.RUBY1_9)
+ public IRubyObject backtrace(ThreadContext context) {
+ return context.createCallerBacktrace(context.getRuntime(), 0);
+ }
+
private boolean isCurrent() {
return threadImpl.isCurrent();
}

0 comments on commit 854f255

Please sign in to comment.