Project

General

Profile

Bug #11692 » example1.rb

Example with puts - gazay (Alex Gaziev), 11/15/2015 05:21 PM

 
class Foo
def to_s
puts self
end
end

Thread.new do
Foo.new.to_s
end

# Stack overflow exception occured and gc switched off

sleep 1

GC.start full_mark: true, immediate_sweep: true

if ObjectSpace.each_object(Thread).count > 1
raise 'Should be only one thread after GC'
else
puts 'All good'
end
(1-1/6)