Skip to content

Commit b94357b

Browse files
committed
Move Object definition to its own file
1 parent 2907026 commit b94357b

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

lib/concurrent/synchronization.rb

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,13 @@
44
require 'concurrent/synchronization/mutex_object'
55
require 'concurrent/synchronization/monitor_object'
66
require 'concurrent/synchronization/rbx_object'
7+
require 'concurrent/synchronization/object'
8+
9+
require 'concurrent/synchronization/immutable_struct'
710

811
module Concurrent
912
# {include:file:doc/synchronization.md}
1013
module Synchronization
11-
Implementation = case
12-
when Concurrent.on_jruby?
13-
JavaObject
14-
when Concurrent.on_cruby? && (RUBY_VERSION.split('.').map(&:to_i) <=> [1, 9, 3]) <= 0
15-
MonitorObject
16-
when Concurrent.on_cruby?
17-
MutexObject
18-
when Concurrent.on_rbx?
19-
RbxObject
20-
else
21-
MutexObject
22-
end
23-
private_constant :Implementation
24-
25-
# @see AbstractObject
26-
class Object < Implementation
27-
end
2814
end
2915
end
3016

31-
require 'concurrent/synchronization/immutable_struct'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module Concurrent
2+
module Synchronization
3+
Implementation = case
4+
when Concurrent.on_jruby?
5+
JavaObject
6+
when Concurrent.on_cruby? && (RUBY_VERSION.split('.').map(&:to_i) <=> [1, 9, 3]) <= 0
7+
MonitorObject
8+
when Concurrent.on_cruby?
9+
MutexObject
10+
when Concurrent.on_rbx?
11+
RbxObject
12+
else
13+
MutexObject
14+
end
15+
private_constant :Implementation
16+
17+
# @see AbstractObject AbstractObject which defines interface of this class.
18+
class Object < Implementation
19+
end
20+
end
21+
end

0 commit comments

Comments
 (0)