Skip to content

Instantly share code, notes, and snippets.

@charleseff
Created June 29, 2012 00:27
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 charleseff/3014927 to your computer and use it in GitHub Desktop.
Save charleseff/3014927 to your computer and use it in GitHub Desktop.
[31] pry(main)> @count = 1
=> 1
[32] pry(main)> t = Thread.new {begin; loop{sleep 1}; ensure @count +=1; end}
=> #<Thread:0x00000102e47ca0 run>
[33] pry(main)> t.kill
=> #<Thread:0x00000102e47ca0 aborting>
[34] pry(main)> @count
=> 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment