Sha256: 83e98309bbf07dc3447211300208b5e5a96ee8c495640a76abadf4e756016e54
Contents?: true
Size: 400 Bytes
Versions: 13
Compression:
Stored size: 400 Bytes
Contents
require 'test/unit' require 'thread_safe' class TestArray < Test::Unit::TestCase def test_concurrency ary = ThreadSafe::Array.new assert_nothing_raised do (1..100).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
Version data entries
13 entries across 13 versions & 3 rubygems