Skip to content

Commit a5f901c

Browse files
committed
Revert "Rollback using Java Exchanger and CountDownLatch implementations"
This reverts commit 1e51d2c.
1 parent 3008823 commit a5f901c

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

lib/concurrent/atomic/count_down_latch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module Concurrent
5555
# @!macro internal_implementation_note
5656
CountDownLatchImplementation = case
5757
when Concurrent.on_jruby?
58-
MutexCountDownLatch
58+
JavaCountDownLatch
5959
else
6060
MutexCountDownLatch
6161
end

lib/concurrent/exchanger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def do_exchange(value, timeout)
329329
# @!macro internal_implementation_note
330330
ExchangerImplementation = case
331331
when Concurrent.on_jruby?
332-
RubyExchanger
332+
JavaExchanger
333333
else
334334
RubyExchanger
335335
end

spec/concurrent/atomic/count_down_latch_spec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,21 @@ def subject.simulate_spurious_wake_up
153153
end
154154
end
155155

156-
# if Concurrent.on_jruby?
157-
# RSpec.describe JavaCountDownLatch do
158-
# it_should_behave_like :count_down_latch
159-
# end
160-
# end
156+
if Concurrent.on_jruby?
157+
RSpec.describe JavaCountDownLatch do
158+
it_should_behave_like :count_down_latch
159+
end
160+
end
161161

162162
RSpec.describe CountDownLatch do
163-
# if Concurrent.on_jruby?
164-
# it 'inherits from JavaCountDownLatch' do
165-
# expect(CountDownLatch.ancestors).to include(JavaCountDownLatch)
166-
# end
167-
# else
168-
it 'inherits from MutexCountDownLatch' do
169-
expect(CountDownLatch.ancestors).to include(MutexCountDownLatch)
163+
if Concurrent.on_jruby?
164+
it 'inherits from JavaCountDownLatch' do
165+
expect(CountDownLatch.ancestors).to include(JavaCountDownLatch)
166+
end
167+
else
168+
it 'inherits from MutexCountDownLatch' do
169+
expect(CountDownLatch.ancestors).to include(MutexCountDownLatch)
170+
end
170171
end
171-
# end
172172
end
173173
end

spec/concurrent/exchanger_spec.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -237,26 +237,26 @@ module Concurrent
237237
end
238238
end
239239

240-
# if defined? JavaExchanger
241-
#
242-
# RSpec.describe JavaExchanger do
243-
# it_behaves_like :exchanger
244-
# end
245-
# end
240+
if defined? JavaExchanger
241+
242+
RSpec.describe JavaExchanger do
243+
it_behaves_like :exchanger
244+
end
245+
end
246246

247247
RSpec.describe Exchanger do
248248

249249
context 'class hierarchy' do
250250

251-
# if Concurrent.on_jruby?
252-
# it 'inherits from JavaExchanger' do
253-
# expect(Exchanger.ancestors).to include(JavaExchanger)
254-
# end
255-
# else
256-
it 'inherits from RubyExchanger' do
257-
expect(Exchanger.ancestors).to include(RubyExchanger)
251+
if Concurrent.on_jruby?
252+
it 'inherits from JavaExchanger' do
253+
expect(Exchanger.ancestors).to include(JavaExchanger)
254+
end
255+
else
256+
it 'inherits from RubyExchanger' do
257+
expect(Exchanger.ancestors).to include(RubyExchanger)
258+
end
258259
end
259-
# end
260260
end
261261
end
262262
end

0 commit comments

Comments
 (0)