Sha256: 55b24845b80a8710cbb9918dd7c2df0b645e8306e947ff51e9ffb1c933fd0380
Contents?: true
Size: 316 Bytes
Versions: 14
Compression:
Stored size: 316 Bytes
Contents
require_relative '../spec_helper' describe Sqewer::AtomicCounter do it 'is atomic' do c = described_class.new expect(c.to_i).to be_zero threads = (1..64).map do Thread.new { sleep(rand); c.increment! } end threads.map(&:join) expect(c.to_i).to eq(threads.length) end end
Version data entries
14 entries across 14 versions & 1 rubygems