Skip to content

Commit 6e3821b

Browse files
committed
Remove Rubinius-related code
* Fixes #972
1 parent 6beb332 commit 6e3821b

23 files changed

+28
-302
lines changed

.github/ISSUE_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Please fill following if applicable, delete otherwise: -->
55
```
66
* Operating system: linux / mac / win
7-
* Ruby implementation: Ruby / JRuby / TruffleRuby / Rubinius
7+
* Ruby implementation: Ruby / JRuby / TruffleRuby
88
* `concurrent-ruby` version: x.y.z
99
* `concurrent-ruby-ext` installed: yes / no
1010
* `concurrent-ruby-edge` used: yes / no

README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ You can also get started by triaging issues which may include reproducing bug re
4242
## Thread Safety
4343

4444
*Concurrent Ruby makes one of the strongest thread safety guarantees of any Ruby concurrency
45-
library, providing consistent behavior and guarantees on all four of the main Ruby interpreters
46-
(MRI/CRuby, JRuby, Rubinius, TruffleRuby).*
45+
library, providing consistent behavior and guarantees on all three main Ruby interpreters
46+
(MRI/CRuby, JRuby, TruffleRuby).*
4747

4848
Every abstraction in this library is thread safe. Specific thread safety guarantees are documented
4949
with each abstraction.
@@ -58,9 +58,9 @@ other Ruby library, many of which support the mantra of
5858
Concurrent Ruby is also the only Ruby library which provides a full suite of thread safe and
5959
immutable variable types and data structures.
6060

61-
We've also initiated discussion to document [memory model](docs-source/synchronization.md) of Ruby which
62-
would provide consistent behaviour and guarantees on all four of the main Ruby interpreters
63-
(MRI/CRuby, JRuby, Rubinius, TruffleRuby).
61+
We've also initiated discussion to document the [memory model](docs-source/synchronization.md) of Ruby which
62+
would provide consistent behaviour and guarantees on all three main Ruby interpreters
63+
(MRI/CRuby, JRuby, TruffleRuby).
6464

6565
## Features & Documentation
6666

@@ -263,9 +263,6 @@ be obeyed though. Features developed in `concurrent-ruby-edge` are expected to m
263263
* Latest JRuby 9000
264264
* Latest TruffleRuby
265265

266-
The legacy support for Rubinius is kept for the moment but it is no longer maintained and is liable to be removed. If you would like to help
267-
please respond to [#739](https://github.com/ruby-concurrency/concurrent-ruby/issues/739).
268-
269266
## Usage
270267

271268
Everything within this gem can be loaded simply by requiring it:

lib/concurrent-ruby/concurrent/array.rb

-10
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ class JRubyArray < ::Array
3434
end
3535
JRubyArray
3636

37-
when Concurrent.on_rbx?
38-
require 'monitor'
39-
require 'concurrent/thread_safe/util/data_structures'
40-
41-
class RbxArray < ::Array
42-
end
43-
44-
ThreadSafe::Util.make_synchronized_on_rbx RbxArray
45-
RbxArray
46-
4737
when Concurrent.on_truffleruby?
4838
require 'concurrent/thread_safe/util/data_structures'
4939

lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb

-16
Original file line numberDiff line numberDiff line change
@@ -171,22 +171,6 @@ class TruffleRubyAtomicReference < TruffleRuby::AtomicReference
171171
alias_method :swap, :get_and_set
172172
end
173173
TruffleRubyAtomicReference
174-
when Concurrent.on_rbx?
175-
# @note Extends `Rubinius::AtomicReference` version adding aliases
176-
# and numeric logic.
177-
#
178-
# @!visibility private
179-
# @!macro internal_implementation_note
180-
class RbxAtomicReference < Rubinius::AtomicReference
181-
alias_method :_compare_and_set, :compare_and_set
182-
include AtomicDirectUpdate
183-
include AtomicNumericCompareAndSetWrapper
184-
alias_method :value, :get
185-
alias_method :value=, :set
186-
alias_method :swap, :get_and_set
187-
alias_method :compare_and_swap, :compare_and_set
188-
end
189-
RbxAtomicReference
190174
else
191175
MutexAtomicReference
192176
end

lib/concurrent-ruby/concurrent/hash.rb

-9
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ class JRubyHash < ::Hash
2828
end
2929
JRubyHash
3030

31-
when Concurrent.on_rbx?
32-
require 'monitor'
33-
require 'concurrent/thread_safe/util/data_structures'
34-
35-
class RbxHash < ::Hash
36-
end
37-
ThreadSafe::Util.make_synchronized_on_rbx RbxHash
38-
RbxHash
39-
4031
when Concurrent.on_truffleruby?
4132
require 'concurrent/thread_safe/util/data_structures'
4233

lib/concurrent-ruby/concurrent/map.rb

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ module Collection
1515
when Concurrent.on_cruby?
1616
require 'concurrent/collection/map/mri_map_backend'
1717
MriMapBackend
18-
when Concurrent.on_truffleruby? && defined?(::TruffleRuby::ConcurrentMap)
19-
require 'concurrent/collection/map/truffleruby_map_backend'
20-
TruffleRubyMapBackend
21-
when Concurrent.on_truffleruby? || Concurrent.on_rbx?
22-
require 'concurrent/collection/map/atomic_reference_map_backend'
23-
AtomicReferenceMapBackend
18+
when Concurrent.on_truffleruby?
19+
if defined?(::TruffleRuby::ConcurrentMap)
20+
require 'concurrent/collection/map/truffleruby_map_backend'
21+
TruffleRubyMapBackend
22+
else
23+
require 'concurrent/collection/map/atomic_reference_map_backend'
24+
AtomicReferenceMapBackend
25+
end
2426
else
2527
warn 'Concurrent::Map: unsupported Ruby engine, using a fully synchronized Concurrent::Map implementation'
2628
require 'concurrent/collection/map/synchronized_map_backend'

lib/concurrent-ruby/concurrent/set.rb

-10
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ class JRubySet < ::Set
4242

4343
JRubySet
4444

45-
when Concurrent.on_rbx?
46-
require 'monitor'
47-
require 'concurrent/thread_safe/util/data_structures'
48-
49-
class RbxSet < ::Set
50-
end
51-
52-
ThreadSafe::Util.make_synchronized_on_rbx RbxSet
53-
RbxSet
54-
5545
when Concurrent.on_truffleruby?
5646
require 'concurrent/thread_safe/util/data_structures'
5747

lib/concurrent-ruby/concurrent/synchronization.rb

-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66

77
require 'concurrent/synchronization/mri_object'
88
require 'concurrent/synchronization/jruby_object'
9-
require 'concurrent/synchronization/rbx_object'
109
require 'concurrent/synchronization/truffleruby_object'
1110
require 'concurrent/synchronization/object'
1211
require 'concurrent/synchronization/volatile'
1312

1413
require 'concurrent/synchronization/abstract_lockable_object'
1514
require 'concurrent/synchronization/mutex_lockable_object'
1615
require 'concurrent/synchronization/jruby_lockable_object'
17-
require 'concurrent/synchronization/rbx_lockable_object'
1816

1917
require 'concurrent/synchronization/lockable_object'
2018

lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ module Synchronization
88
MutexLockableObject
99
when Concurrent.on_jruby?
1010
JRubyLockableObject
11-
when Concurrent.on_rbx?
12-
RbxLockableObject
1311
when Concurrent.on_truffleruby?
1412
MutexLockableObject
1513
else

lib/concurrent-ruby/concurrent/synchronization/object.rb

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ module Synchronization
88
MriObject
99
when Concurrent.on_jruby?
1010
JRubyObject
11-
when Concurrent.on_rbx?
12-
RbxObject
1311
when Concurrent.on_truffleruby?
1412
TruffleRubyObject
1513
else

lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb

-71
This file was deleted.

lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb

-49
This file was deleted.

lib/concurrent-ruby/concurrent/synchronization/volatile.rb

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ module Synchronization
2525
MriAttrVolatile
2626
when Concurrent.on_jruby?
2727
JRubyAttrVolatile
28-
when Concurrent.on_rbx?
29-
RbxAttrVolatile
3028
when Concurrent.on_truffleruby?
3129
TruffleRubyAttrVolatile
3230
else

lib/concurrent-ruby/concurrent/thread_safe/util/cheap_lockable.rb

+1-38
Original file line numberDiff line numberDiff line change
@@ -32,44 +32,7 @@ module Util
3232
# @!visibility private
3333
module CheapLockable
3434
private
35-
if Concurrent.on_rbx?
36-
# Making use of the Rubinius' ability to lock via object headers to avoid the overhead of the extra Mutex objects.
37-
def cheap_synchronize
38-
Rubinius.lock(self)
39-
begin
40-
yield
41-
ensure
42-
Rubinius.unlock(self)
43-
end
44-
end
45-
46-
def cheap_wait
47-
wchan = Rubinius::Channel.new
48-
49-
begin
50-
waiters = @waiters ||= []
51-
waiters.push wchan
52-
Rubinius.unlock(self)
53-
signaled = wchan.receive_timeout nil
54-
ensure
55-
Rubinius.lock(self)
56-
57-
unless signaled or waiters.delete(wchan)
58-
# we timed out, but got signaled afterwards (e.g. while waiting to
59-
# acquire @lock), so pass that signal on to the next waiter
60-
waiters.shift << true unless waiters.empty?
61-
end
62-
end
63-
64-
self
65-
end
66-
67-
def cheap_broadcast
68-
waiters = @waiters ||= []
69-
waiters.shift << true until waiters.empty?
70-
self
71-
end
72-
elsif Concurrent.on_jruby?
35+
if Concurrent.on_jruby?
7336
# Use Java's native synchronized (this) { wait(); notifyAll(); } to avoid the overhead of the extra Mutex objects
7437
require 'jruby'
7538

lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb

-37
Original file line numberDiff line numberDiff line change
@@ -37,43 +37,6 @@ def #{method}(*args)
3737
end
3838
end
3939

40-
def self.make_synchronized_on_rbx(klass)
41-
klass.class_eval do
42-
private
43-
44-
def _mon_initialize
45-
@_monitor ||= Monitor.new # avoid double initialisation
46-
end
47-
48-
def self.new(*args)
49-
obj = super(*args)
50-
obj.send(:_mon_initialize)
51-
obj
52-
end
53-
end
54-
55-
klass.superclass.instance_methods(false).each do |method|
56-
case method
57-
when :new_range, :new_reserved
58-
klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1
59-
def #{method}(*args)
60-
obj = super
61-
obj.send(:_mon_initialize)
62-
obj
63-
end
64-
RUBY
65-
else
66-
klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1
67-
def #{method}(*args)
68-
monitor = @_monitor
69-
monitor or raise("BUG: Internal monitor was not properly initialized. Please report this to the concurrent-ruby developers.")
70-
monitor.synchronize { super }
71-
end
72-
RUBY
73-
end
74-
end
75-
end
76-
7740
def self.make_synchronized_on_truffleruby(klass)
7841
klass.superclass.instance_methods(false).each do |method|
7942
klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1

0 commit comments

Comments
 (0)