Skip to content

Instantly share code, notes, and snippets.

@dekz
Created July 16, 2012 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dekz/3120249 to your computer and use it in GitHub Desktop.
Save dekz/3120249 to your computer and use it in GitHub Desktop.
JRuby __jtrap
done
#<NoMethodError: undefined method `__jtrap' for #<Zab:0x153b2cb>>
#<NoMethodError: undefined method `__jtrap' for #<Zab:0x3c63e8c>>
#<NoMethodError: undefined method `__jtrap' for #<Zab:0x2e694f12>>
#<NoMethodError: undefined method `__jtrap' for #<Zab:0x26dfe303>>
class Zab
def start
trap(:INT) do
puts 'a'
end
end
end
def test
Thread.new do
z = Zab.new
begin
z.start
rescue Exception => e
p e
end
end
end
5.times { test }
puts 'done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment