Skip to content

Instantly share code, notes, and snippets.

@BanzaiMan
Created April 8, 2010 04:52
Show Gist options
  • Select an option

  • Save BanzaiMan/359785 to your computer and use it in GitHub Desktop.

Select an option

Save BanzaiMan/359785 to your computer and use it in GitHub Desktop.
irb(main):003:0> a = Thread.new{ begin; sleep 3; select(nil,nil,nil,nil); rescue; puts 'rescued'; end; puts 'done'; }
=> #<Thread:0x2bf8f8c8sleep>
irb(main):004:0> a.raise "hello"
=> #<Thread:0x2bf8f8c8sleep>
irb(main):005:0> rescued
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment