Skip to content

Instantly share code, notes, and snippets.

@chadbailey59
Last active August 29, 2015 14:01
Show Gist options
  • Save chadbailey59/b5f08b3359ef9a00e90f to your computer and use it in GitHub Desktop.
Save chadbailey59/b5f08b3359ef9a00e90f to your computer and use it in GitHub Desktop.
class Tester
def foo
bar
end
def bar
baz
end
def baz
sleep 1
end
end
t1 = Thread.new do
Tester.new.foo
end
puts "t1 started"
puts "t1 backtrace: #{t1.backtrace}"
t1.join
puts "t1 joined"
---
t1 started
t1 backtrace: ["test.rb:11:in `sleep'", "test.rb:11:in `baz'", "test.rb:7:in `bar'", "test.rb:3:in `foo'", "test.rb:17:in `block in <main>'"]
t1 joined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment