Skip to content

Instantly share code, notes, and snippets.

@ledestin
Created November 14, 2014 04:16
Show Gist options
  • Save ledestin/d099f12bf43d0539973f to your computer and use it in GitHub Desktop.
Save ledestin/d099f12bf43d0539973f to your computer and use it in GitHub Desktop.
require 'thread'
class A
def initialize
#Thread.new { foo }
ObjectSpace.define_finalizer self, proc { puts 'yes' }
end
def foo
sleep
end
end
A.new
GC.start
sleep 0.1 until false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment