Skip to content

Commit 1241953

Browse files
committed
Merge pull request #215 from ruby-concurrency/thread-local-var
Add sleeps to stabilize tests
2 parents 6e8cf5f + c9af018 commit 1241953

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

lib/concurrent/atomics.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
require 'concurrent/atomic/event'
1010
require 'concurrent/atomic/synchronization'
1111
require 'concurrent/atomic/semaphore'
12+
require 'concurrent/atomic/thread_local_var'

spec/concurrent/atomic/semaphore_spec.rb

100755100644
File mode changed.

spec/concurrent/atomic/thread_local_var_spec.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,6 @@ module Concurrent
5050
var.value = 0
5151
expect(var.instance_variable_get(:@storage).keys.size).to be == 1
5252
end
53-
54-
it 'does not leave values behind when bind is not used' do
55-
if rbx?
56-
pending('fails on Rbx, possibly due to test dependency on GC')
57-
end
58-
tries = Array.new(10) do
59-
var = ThreadLocalVar.new(0)
60-
10.times.map do |i|
61-
Thread.new { var.value = i; var.value }
62-
end.each(&:join)
63-
var.value = 0
64-
GC.start
65-
var.instance_variable_get(:@storage).keys.size == 1
66-
end
67-
expect(tries.any?).to be_truthy
68-
end
6953
end
7054
end
7155

0 commit comments

Comments
 (0)