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

Version Path
thread_safe-0.1.3 test/test_array.rb
thread_safe-0.1.3-java test/test_array.rb
thread_safe-ianunruh-0.1.1 test/test_array.rb
thread_safe-ianunruh-0.1.1-java test/test_array.rb
thread_safe-0.1.2 test/test_array.rb
thread_safe-0.1.2-java test/test_array.rb
thread_safe-0.1.1 test/test_array.rb
thread_safe-0.1.1-java test/test_array.rb
challah-1.0.0 vendor/bundle/gems/thread_safe-0.1.0/test/test_array.rb
thread_safe-0.1.0 test/test_array.rb
thread_safe-0.0.3 test/test_array.rb
thread_safe-0.0.2 test/test_array.rb
thread_safe-0.0.1 test/test_array.rb