HEX
Server: Apache
System: Windows NT MAGNETO-ARM 10.0 build 22000 (Windows 10) AMD64
User: Michel (0)
PHP: 7.4.7
Disabled: NONE
Upload Files
File: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thread_safe-0.3.6/spec/thread_safe/array_spec.rb
module ThreadSafe
  describe Array do
    let!(:ary) { described_class.new }

    it 'concurrency' do
      (1..THREADS).map do |i|
        Thread.new do
          1000.times do
            ary << i
            ary.each { |x| x * 2 }
            ary.shift
            ary.last
          end
        end
      end.map(&:join)
    end
  end
end