Sha256: 34aa96497b82d62f1729b92396897f0a215ab11ae0ab9df21a9ecc8d7a7ced0d

Contents?: true

Size: 401 Bytes

Versions: 8

Compression:

Stored size: 401 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

8 entries across 8 versions & 1 rubygems

Version Path
thread_safe-0.3.3-java test/test_array.rb
thread_safe-0.3.3 test/test_array.rb
thread_safe-0.3.2-java test/test_array.rb
thread_safe-0.3.2 test/test_array.rb
thread_safe-0.3.1 test/test_array.rb
thread_safe-0.3.1-java test/test_array.rb
thread_safe-0.2.0-java test/test_array.rb
thread_safe-0.2.0 test/test_array.rb