concurrent-ruby 1.0.5 → 1.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +155 -0
  3. data/Gemfile +37 -0
  4. data/LICENSE.txt +18 -18
  5. data/README.md +260 -103
  6. data/Rakefile +329 -0
  7. data/ext/concurrent-ruby/ConcurrentRubyService.java +17 -0
  8. data/ext/concurrent-ruby/com/concurrent_ruby/ext/AtomicReferenceLibrary.java +175 -0
  9. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JRubyMapBackendLibrary.java +248 -0
  10. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicBooleanLibrary.java +93 -0
  11. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicFixnumLibrary.java +113 -0
  12. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaSemaphoreLibrary.java +189 -0
  13. data/ext/concurrent-ruby/com/concurrent_ruby/ext/SynchronizationLibrary.java +307 -0
  14. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMap.java +31 -0
  15. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java +3863 -0
  16. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/LongAdder.java +203 -0
  17. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/Striped64.java +342 -0
  18. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java +3800 -0
  19. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/LongAdder.java +204 -0
  20. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/Striped64.java +291 -0
  21. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166y/ThreadLocalRandom.java +199 -0
  22. data/lib/{concurrent → concurrent-ruby/concurrent}/agent.rb +7 -7
  23. data/lib/concurrent-ruby/concurrent/array.rb +66 -0
  24. data/lib/{concurrent → concurrent-ruby/concurrent}/async.rb +28 -24
  25. data/lib/{concurrent → concurrent-ruby/concurrent}/atom.rb +10 -10
  26. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/atomic_boolean.rb +26 -22
  27. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/atomic_fixnum.rb +27 -23
  28. data/lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb +164 -0
  29. data/lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb +205 -0
  30. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/count_down_latch.rb +7 -7
  31. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/cyclic_barrier.rb +1 -1
  32. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/event.rb +3 -3
  33. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/java_count_down_latch.rb +9 -6
  34. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_atomic_boolean.rb +2 -0
  35. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_count_down_latch.rb +1 -0
  36. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_semaphore.rb +18 -2
  37. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/read_write_lock.rb +2 -1
  38. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/reentrant_read_write_lock.rb +7 -7
  39. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/ruby_thread_local_var.rb +60 -40
  40. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/semaphore.rb +34 -13
  41. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/thread_local_var.rb +8 -8
  42. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic_reference/mutex_atomic.rb +3 -8
  43. data/lib/{concurrent → concurrent-ruby/concurrent}/atomic_reference/numeric_cas_wrapper.rb +1 -1
  44. data/lib/concurrent-ruby/concurrent/atomics.rb +10 -0
  45. data/lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb +158 -0
  46. data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/atomic_reference_map_backend.rb +3 -3
  47. data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/mri_map_backend.rb +1 -1
  48. data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/non_concurrent_map_backend.rb +1 -2
  49. data/lib/concurrent-ruby/concurrent/collection/map/truffleruby_map_backend.rb +14 -0
  50. data/lib/{concurrent → concurrent-ruby/concurrent}/collection/non_concurrent_priority_queue.rb +30 -30
  51. data/lib/{concurrent → concurrent-ruby/concurrent}/collection/ruby_non_concurrent_priority_queue.rb +11 -1
  52. data/lib/{concurrent → concurrent-ruby/concurrent}/concern/dereferenceable.rb +3 -3
  53. data/lib/{concurrent → concurrent-ruby/concurrent}/concern/logging.rb +6 -1
  54. data/lib/{concurrent → concurrent-ruby/concurrent}/concern/observable.rb +7 -7
  55. data/lib/concurrent-ruby/concurrent/concurrent_ruby.jar +0 -0
  56. data/lib/{concurrent → concurrent-ruby/concurrent}/configuration.rb +15 -15
  57. data/lib/{concurrent → concurrent-ruby/concurrent}/constants.rb +1 -1
  58. data/lib/{concurrent → concurrent-ruby/concurrent}/dataflow.rb +2 -1
  59. data/lib/{concurrent → concurrent-ruby/concurrent}/delay.rb +9 -7
  60. data/lib/{concurrent → concurrent-ruby/concurrent}/exchanger.rb +21 -25
  61. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/abstract_executor_service.rb +35 -38
  62. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/cached_thread_pool.rb +5 -5
  63. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/executor_service.rb +17 -17
  64. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/fixed_thread_pool.rb +47 -33
  65. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/java_executor_service.rb +20 -17
  66. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/java_single_thread_executor.rb +4 -3
  67. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/java_thread_pool_executor.rb +29 -9
  68. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/ruby_executor_service.rb +10 -6
  69. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/ruby_single_thread_executor.rb +0 -1
  70. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/ruby_thread_pool_executor.rb +46 -42
  71. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/safe_task_executor.rb +5 -5
  72. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/simple_executor_service.rb +1 -1
  73. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/single_thread_executor.rb +3 -2
  74. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/thread_pool_executor.rb +7 -6
  75. data/lib/{concurrent → concurrent-ruby/concurrent}/executor/timer_set.rb +14 -17
  76. data/lib/{concurrent → concurrent-ruby/concurrent}/future.rb +4 -1
  77. data/lib/concurrent-ruby/concurrent/hash.rb +59 -0
  78. data/lib/{concurrent → concurrent-ruby/concurrent}/immutable_struct.rb +9 -1
  79. data/lib/{concurrent → concurrent-ruby/concurrent}/ivar.rb +5 -6
  80. data/lib/concurrent-ruby/concurrent/map.rb +346 -0
  81. data/lib/{concurrent → concurrent-ruby/concurrent}/maybe.rb +1 -1
  82. data/lib/{concurrent → concurrent-ruby/concurrent}/mutable_struct.rb +27 -16
  83. data/lib/{concurrent → concurrent-ruby/concurrent}/mvar.rb +2 -2
  84. data/lib/{concurrent → concurrent-ruby/concurrent}/promise.rb +54 -21
  85. data/lib/concurrent-ruby/concurrent/promises.rb +2167 -0
  86. data/lib/concurrent-ruby/concurrent/re_include.rb +58 -0
  87. data/lib/{concurrent → concurrent-ruby/concurrent}/scheduled_task.rb +29 -16
  88. data/lib/concurrent-ruby/concurrent/set.rb +74 -0
  89. data/lib/{concurrent → concurrent-ruby/concurrent}/settable_struct.rb +12 -1
  90. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_lockable_object.rb +5 -5
  91. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_struct.rb +18 -4
  92. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/condition.rb +2 -0
  93. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/jruby_object.rb +1 -0
  94. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/lock.rb +2 -0
  95. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/lockable_object.rb +8 -10
  96. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/mri_object.rb +1 -0
  97. data/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb +88 -0
  98. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/object.rb +53 -23
  99. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/rbx_lockable_object.rb +6 -0
  100. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/rbx_object.rb +1 -0
  101. data/lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb +47 -0
  102. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/volatile.rb +11 -9
  103. data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization.rb +4 -5
  104. data/lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb +88 -0
  105. data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/striped64.rb +9 -4
  106. data/lib/{concurrent → concurrent-ruby/concurrent}/timer_task.rb +15 -35
  107. data/lib/{concurrent → concurrent-ruby/concurrent}/tuple.rb +1 -1
  108. data/lib/{concurrent → concurrent-ruby/concurrent}/tvar.rb +21 -58
  109. data/lib/{concurrent → concurrent-ruby/concurrent}/utility/engine.rb +4 -4
  110. data/lib/concurrent-ruby/concurrent/utility/monotonic_time.rb +90 -0
  111. data/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb +79 -0
  112. data/lib/{concurrent → concurrent-ruby/concurrent}/utility/processor_counter.rb +5 -35
  113. data/lib/concurrent-ruby/concurrent/version.rb +3 -0
  114. data/lib/concurrent-ruby/concurrent-ruby.rb +5 -0
  115. data/lib/{concurrent.rb → concurrent-ruby/concurrent.rb} +24 -20
  116. metadata +149 -134
  117. data/lib/concurrent/array.rb +0 -39
  118. data/lib/concurrent/atomic/atomic_reference.rb +0 -51
  119. data/lib/concurrent/atomic_reference/concurrent_update_error.rb +0 -8
  120. data/lib/concurrent/atomic_reference/direct_update.rb +0 -81
  121. data/lib/concurrent/atomic_reference/jruby+truffle.rb +0 -2
  122. data/lib/concurrent/atomic_reference/jruby.rb +0 -16
  123. data/lib/concurrent/atomic_reference/rbx.rb +0 -22
  124. data/lib/concurrent/atomic_reference/ruby.rb +0 -32
  125. data/lib/concurrent/atomics.rb +0 -53
  126. data/lib/concurrent/edge.rb +0 -26
  127. data/lib/concurrent/hash.rb +0 -36
  128. data/lib/concurrent/lazy_register.rb +0 -81
  129. data/lib/concurrent/map.rb +0 -240
  130. data/lib/concurrent/synchronization/mri_lockable_object.rb +0 -71
  131. data/lib/concurrent/synchronization/truffle_lockable_object.rb +0 -9
  132. data/lib/concurrent/synchronization/truffle_object.rb +0 -31
  133. data/lib/concurrent/thread_safe/util/array_hash_rbx.rb +0 -30
  134. data/lib/concurrent/utility/at_exit.rb +0 -97
  135. data/lib/concurrent/utility/monotonic_time.rb +0 -58
  136. data/lib/concurrent/utility/native_extension_loader.rb +0 -73
  137. data/lib/concurrent/version.rb +0 -4
  138. /data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/abstract_thread_local_var.rb +0 -0
  139. /data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/java_thread_local_var.rb +0 -0
  140. /data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_atomic_fixnum.rb +0 -0
  141. /data/lib/{concurrent → concurrent-ruby/concurrent}/collection/copy_on_notify_observer_set.rb +0 -0
  142. /data/lib/{concurrent → concurrent-ruby/concurrent}/collection/copy_on_write_observer_set.rb +0 -0
  143. /data/lib/{concurrent → concurrent-ruby/concurrent}/collection/java_non_concurrent_priority_queue.rb +0 -0
  144. /data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/synchronized_map_backend.rb +0 -0
  145. /data/lib/{concurrent → concurrent-ruby/concurrent}/concern/deprecation.rb +0 -0
  146. /data/lib/{concurrent → concurrent-ruby/concurrent}/concern/obligation.rb +0 -0
  147. /data/lib/{concurrent → concurrent-ruby/concurrent}/errors.rb +0 -0
  148. /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/immediate_executor.rb +0 -0
  149. /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/indirect_immediate_executor.rb +0 -0
  150. /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/serial_executor_service.rb +0 -0
  151. /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/serialized_execution.rb +0 -0
  152. /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/serialized_execution_delegator.rb +0 -0
  153. /data/lib/{concurrent → concurrent-ruby/concurrent}/executors.rb +0 -0
  154. /data/lib/{concurrent → concurrent-ruby/concurrent}/options.rb +0 -0
  155. /data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_object.rb +0 -0
  156. /data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/jruby_lockable_object.rb +0 -0
  157. /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/synchronized_delegator.rb +0 -0
  158. /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/adder.rb +0 -0
  159. /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/cheap_lockable.rb +0 -0
  160. /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/power_of_two_tuple.rb +0 -0
  161. /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/volatile.rb +0 -0
  162. /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/xor_shift_random.rb +0 -0
  163. /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util.rb +0 -0
  164. /data/lib/{concurrent → concurrent-ruby/concurrent}/utility/native_integer.rb +0 -0
@@ -0,0 +1,79 @@
1
+ require 'concurrent/utility/engine'
2
+
3
+ module Concurrent
4
+
5
+ module Utility
6
+
7
+ # @!visibility private
8
+ module NativeExtensionLoader
9
+
10
+ def allow_c_extensions?
11
+ Concurrent.on_cruby?
12
+ end
13
+
14
+ def c_extensions_loaded?
15
+ defined?(@c_extensions_loaded) && @c_extensions_loaded
16
+ end
17
+
18
+ def java_extensions_loaded?
19
+ defined?(@java_extensions_loaded) && @java_extensions_loaded
20
+ end
21
+
22
+ def load_native_extensions
23
+ unless defined? Synchronization::AbstractObject
24
+ raise 'native_extension_loader loaded before Synchronization::AbstractObject'
25
+ end
26
+
27
+ if Concurrent.on_cruby? && !c_extensions_loaded?
28
+ ['concurrent/concurrent_ruby_ext',
29
+ "concurrent/#{RUBY_VERSION[0..2]}/concurrent_ruby_ext"
30
+ ].each { |p| try_load_c_extension p }
31
+ end
32
+
33
+ if Concurrent.on_jruby? && !java_extensions_loaded?
34
+ begin
35
+ require 'concurrent/concurrent_ruby.jar'
36
+ set_java_extensions_loaded
37
+ rescue LoadError => e
38
+ raise e, "Java extensions are required for JRuby.\n" + e.message, e.backtrace
39
+ end
40
+ end
41
+ end
42
+
43
+ private
44
+
45
+ def load_error_path(error)
46
+ if error.respond_to? :path
47
+ error.path
48
+ else
49
+ error.message.split(' -- ').last
50
+ end
51
+ end
52
+
53
+ def set_c_extensions_loaded
54
+ @c_extensions_loaded = true
55
+ end
56
+
57
+ def set_java_extensions_loaded
58
+ @java_extensions_loaded = true
59
+ end
60
+
61
+ def try_load_c_extension(path)
62
+ require path
63
+ set_c_extensions_loaded
64
+ rescue LoadError => e
65
+ if load_error_path(e) == path
66
+ # move on with pure-Ruby implementations
67
+ # TODO (pitr-ch 12-Jul-2018): warning on verbose?
68
+ else
69
+ raise e
70
+ end
71
+ end
72
+
73
+ end
74
+ end
75
+
76
+ # @!visibility private
77
+ extend Utility::NativeExtensionLoader
78
+ end
79
+
@@ -1,3 +1,4 @@
1
+ require 'etc'
1
2
  require 'rbconfig'
2
3
  require 'concurrent/delay'
3
4
 
@@ -22,6 +23,8 @@ module Concurrent
22
23
  # occasionally poll this property." Subsequently the result will NOT be
23
24
  # memoized under JRuby.
24
25
  #
26
+ # Ruby's Etc.nprocessors will be used if available (MRI 2.2+).
27
+ #
25
28
  # On Windows the Win32 API will be queried for the
26
29
  # `NumberOfLogicalProcessors from Win32_Processor`. This will return the
27
30
  # total number "logical processors for the current instance of the
@@ -76,47 +79,14 @@ module Concurrent
76
79
  def compute_processor_count
77
80
  if Concurrent.on_jruby?
78
81
  java.lang.Runtime.getRuntime.availableProcessors
79
- elsif Concurrent.on_truffle?
80
- Truffle::Primitive.logical_processors
81
82
  else
82
- os_name = RbConfig::CONFIG["target_os"]
83
- if os_name =~ /mingw|mswin/
84
- require 'win32ole'
85
- result = WIN32OLE.connect("winmgmts://").ExecQuery(
86
- "select NumberOfLogicalProcessors from Win32_Processor")
87
- result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+)
88
- elsif File.readable?("/proc/cpuinfo") && (cpuinfo_count = IO.read("/proc/cpuinfo").scan(/^processor/).size) > 0
89
- cpuinfo_count
90
- elsif File.executable?("/usr/bin/nproc")
91
- IO.popen("/usr/bin/nproc --all", &:read).to_i
92
- elsif File.executable?("/usr/bin/hwprefs")
93
- IO.popen("/usr/bin/hwprefs thread_count", &:read).to_i
94
- elsif File.executable?("/usr/sbin/psrinfo")
95
- IO.popen("/usr/sbin/psrinfo", &:read).scan(/^.*on-*line/).size
96
- elsif File.executable?("/usr/sbin/ioscan")
97
- IO.popen("/usr/sbin/ioscan -kC processor", &:read).scan(/^.*processor/).size
98
- elsif File.executable?("/usr/sbin/pmcycles")
99
- IO.popen("/usr/sbin/pmcycles -m", &:read).count("\n")
100
- elsif File.executable?("/usr/sbin/lsdev")
101
- IO.popen("/usr/sbin/lsdev -Cc processor -S 1", &:read).count("\n")
102
- elsif File.executable?("/usr/sbin/sysconf") and os_name =~ /irix/i
103
- IO.popen("/usr/sbin/sysconf NPROC_ONLN", &:read).to_i
104
- elsif File.executable?("/usr/sbin/sysctl")
105
- IO.popen("/usr/sbin/sysctl -n hw.ncpu", &:read).to_i
106
- elsif File.executable?("/sbin/sysctl")
107
- IO.popen("/sbin/sysctl -n hw.ncpu", &:read).to_i
108
- else
109
- # TODO (pitr-ch 05-Nov-2016): warn about failures
110
- 1
111
- end
83
+ Etc.nprocessors
112
84
  end
113
- rescue
114
- return 1
115
85
  end
116
86
 
117
87
  def compute_physical_processor_count
118
88
  ppc = case RbConfig::CONFIG["target_os"]
119
- when /darwin1/
89
+ when /darwin\d\d/
120
90
  IO.popen("/usr/sbin/sysctl -n hw.physicalcpu", &:read).to_i
121
91
  when /linux/
122
92
  cores = {} # unique physical ID / core ID combinations
@@ -0,0 +1,3 @@
1
+ module Concurrent
2
+ VERSION = '1.1.10'
3
+ end
@@ -0,0 +1,5 @@
1
+ # This file is here so that there is a file with the same name as the gem that
2
+ # can be required by Bundler.require. Applications should normally
3
+ # require 'concurrent'.
4
+
5
+ require_relative "concurrent"
@@ -7,11 +7,13 @@ require 'concurrent/atomics'
7
7
  require 'concurrent/executors'
8
8
  require 'concurrent/synchronization'
9
9
 
10
+ require 'concurrent/atomic/atomic_markable_reference'
10
11
  require 'concurrent/atomic/atomic_reference'
11
12
  require 'concurrent/agent'
12
13
  require 'concurrent/atom'
13
14
  require 'concurrent/array'
14
15
  require 'concurrent/hash'
16
+ require 'concurrent/set'
15
17
  require 'concurrent/map'
16
18
  require 'concurrent/tuple'
17
19
  require 'concurrent/async'
@@ -29,20 +31,21 @@ require 'concurrent/scheduled_task'
29
31
  require 'concurrent/settable_struct'
30
32
  require 'concurrent/timer_task'
31
33
  require 'concurrent/tvar'
34
+ require 'concurrent/promises'
32
35
 
33
36
  require 'concurrent/thread_safe/synchronized_delegator'
34
37
  require 'concurrent/thread_safe/util'
35
38
 
36
39
  require 'concurrent/options'
37
40
 
38
- # @!macro [new] internal_implementation_note
41
+ # @!macro internal_implementation_note
39
42
  #
40
43
  # @note **Private Implementation:** This abstraction is a private, internal
41
44
  # implementation detail. It should never be used directly.
42
45
 
43
- # @!macro [new] monotonic_clock_warning
46
+ # @!macro monotonic_clock_warning
44
47
  #
45
- # @note Time calculations one all platforms and languages are sensitive to
48
+ # @note Time calculations on all platforms and languages are sensitive to
46
49
  # changes to the system clock. To alleviate the potential problems
47
50
  # associated with changing the system clock while an application is running,
48
51
  # most modern operating systems provide a monotonic clock that operates
@@ -58,7 +61,7 @@ require 'concurrent/options'
58
61
  #
59
62
  # @see http://linux.die.net/man/3/clock_gettime Linux clock_gettime(3)
60
63
 
61
- # @!macro [new] copy_options
64
+ # @!macro copy_options
62
65
  #
63
66
  # ## Copy Options
64
67
  #
@@ -94,7 +97,7 @@ require 'concurrent/options'
94
97
  # as close to the behavior of a "pure" functional language (like Erlang, Clojure,
95
98
  # or Haskell) as we are likely to get in Ruby.
96
99
 
97
- # @!macro [attach] deref_options
100
+ # @!macro deref_options
98
101
  #
99
102
  # @option opts [Boolean] :dup_on_deref (false) Call `#dup` before
100
103
  # returning the data from {#value}
@@ -104,27 +107,28 @@ require 'concurrent/options'
104
107
  # method, call the given proc passing the internal value as the sole
105
108
  # argument then return the new value returned from the proc.
106
109
 
107
- # @!macro [attach] executor_and_deref_options
110
+ # @!macro executor_and_deref_options
108
111
  #
109
112
  # @param [Hash] opts the options used to define the behavior at update and deref
110
113
  # and to specify the executor on which to perform actions
111
114
  # @option opts [Executor] :executor when set use the given `Executor` instance.
112
- # Three special values are also supported: `:task` returns the global task pool,
113
- # `:operation` returns the global operation pool, and `:immediate` returns a new
114
- # `ImmediateExecutor` object.
115
+ # Three special values are also supported: `:io` returns the global pool for
116
+ # long, blocking (IO) tasks, `:fast` returns the global pool for short, fast
117
+ # operations, and `:immediate` returns the global `ImmediateExecutor` object.
115
118
  # @!macro deref_options
116
119
 
117
- # Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell,
118
- # F#, C#, Java, and classic concurrency patterns.
120
+ # @!macro warn.edge
121
+ # @api Edge
122
+ # @note **Edge Features** are under active development and may change frequently.
119
123
  #
120
- # The design goals of this gem are:
121
- #
122
- # * Stay true to the spirit of the languages providing inspiration
123
- # * But implement in a way that makes sense for Ruby
124
- # * Keep the semantics as idiomatic Ruby as possible
125
- # * Support features that make sense in Ruby
126
- # * Exclude features that don't make sense in Ruby
127
- # * Be small, lean, and loosely coupled
128
- module Concurrent
124
+ # - Deprecations are not added before incompatible changes.
125
+ # - Edge version: _major_ is always 0, _minor_ bump means incompatible change,
126
+ # _patch_ bump means compatible change.
127
+ # - Edge features may also lack tests and documentation.
128
+ # - Features developed in `concurrent-ruby-edge` are expected to move
129
+ # to `concurrent-ruby` when finalised.
129
130
 
131
+
132
+ # {include:file:README.md}
133
+ module Concurrent
130
134
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concurrent-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry D'Antonio
8
8
  - Petr Chalupa
9
9
  - The Ruby Concurrency Team
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-02-26 00:00:00.000000000 Z
13
+ date: 2022-03-22 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: |
16
16
  Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
@@ -24,155 +24,170 @@ extra_rdoc_files:
24
24
  - CHANGELOG.md
25
25
  files:
26
26
  - CHANGELOG.md
27
+ - Gemfile
27
28
  - LICENSE.txt
28
29
  - README.md
29
- - lib/concurrent.rb
30
- - lib/concurrent/agent.rb
31
- - lib/concurrent/array.rb
32
- - lib/concurrent/async.rb
33
- - lib/concurrent/atom.rb
34
- - lib/concurrent/atomic/abstract_thread_local_var.rb
35
- - lib/concurrent/atomic/atomic_boolean.rb
36
- - lib/concurrent/atomic/atomic_fixnum.rb
37
- - lib/concurrent/atomic/atomic_reference.rb
38
- - lib/concurrent/atomic/count_down_latch.rb
39
- - lib/concurrent/atomic/cyclic_barrier.rb
40
- - lib/concurrent/atomic/event.rb
41
- - lib/concurrent/atomic/java_count_down_latch.rb
42
- - lib/concurrent/atomic/java_thread_local_var.rb
43
- - lib/concurrent/atomic/mutex_atomic_boolean.rb
44
- - lib/concurrent/atomic/mutex_atomic_fixnum.rb
45
- - lib/concurrent/atomic/mutex_count_down_latch.rb
46
- - lib/concurrent/atomic/mutex_semaphore.rb
47
- - lib/concurrent/atomic/read_write_lock.rb
48
- - lib/concurrent/atomic/reentrant_read_write_lock.rb
49
- - lib/concurrent/atomic/ruby_thread_local_var.rb
50
- - lib/concurrent/atomic/semaphore.rb
51
- - lib/concurrent/atomic/thread_local_var.rb
52
- - lib/concurrent/atomic_reference/concurrent_update_error.rb
53
- - lib/concurrent/atomic_reference/direct_update.rb
54
- - lib/concurrent/atomic_reference/jruby+truffle.rb
55
- - lib/concurrent/atomic_reference/jruby.rb
56
- - lib/concurrent/atomic_reference/mutex_atomic.rb
57
- - lib/concurrent/atomic_reference/numeric_cas_wrapper.rb
58
- - lib/concurrent/atomic_reference/rbx.rb
59
- - lib/concurrent/atomic_reference/ruby.rb
60
- - lib/concurrent/atomics.rb
61
- - lib/concurrent/collection/copy_on_notify_observer_set.rb
62
- - lib/concurrent/collection/copy_on_write_observer_set.rb
63
- - lib/concurrent/collection/java_non_concurrent_priority_queue.rb
64
- - lib/concurrent/collection/map/atomic_reference_map_backend.rb
65
- - lib/concurrent/collection/map/mri_map_backend.rb
66
- - lib/concurrent/collection/map/non_concurrent_map_backend.rb
67
- - lib/concurrent/collection/map/synchronized_map_backend.rb
68
- - lib/concurrent/collection/non_concurrent_priority_queue.rb
69
- - lib/concurrent/collection/ruby_non_concurrent_priority_queue.rb
70
- - lib/concurrent/concern/deprecation.rb
71
- - lib/concurrent/concern/dereferenceable.rb
72
- - lib/concurrent/concern/logging.rb
73
- - lib/concurrent/concern/obligation.rb
74
- - lib/concurrent/concern/observable.rb
75
- - lib/concurrent/configuration.rb
76
- - lib/concurrent/constants.rb
77
- - lib/concurrent/dataflow.rb
78
- - lib/concurrent/delay.rb
79
- - lib/concurrent/edge.rb
80
- - lib/concurrent/errors.rb
81
- - lib/concurrent/exchanger.rb
82
- - lib/concurrent/executor/abstract_executor_service.rb
83
- - lib/concurrent/executor/cached_thread_pool.rb
84
- - lib/concurrent/executor/executor_service.rb
85
- - lib/concurrent/executor/fixed_thread_pool.rb
86
- - lib/concurrent/executor/immediate_executor.rb
87
- - lib/concurrent/executor/indirect_immediate_executor.rb
88
- - lib/concurrent/executor/java_executor_service.rb
89
- - lib/concurrent/executor/java_single_thread_executor.rb
90
- - lib/concurrent/executor/java_thread_pool_executor.rb
91
- - lib/concurrent/executor/ruby_executor_service.rb
92
- - lib/concurrent/executor/ruby_single_thread_executor.rb
93
- - lib/concurrent/executor/ruby_thread_pool_executor.rb
94
- - lib/concurrent/executor/safe_task_executor.rb
95
- - lib/concurrent/executor/serial_executor_service.rb
96
- - lib/concurrent/executor/serialized_execution.rb
97
- - lib/concurrent/executor/serialized_execution_delegator.rb
98
- - lib/concurrent/executor/simple_executor_service.rb
99
- - lib/concurrent/executor/single_thread_executor.rb
100
- - lib/concurrent/executor/thread_pool_executor.rb
101
- - lib/concurrent/executor/timer_set.rb
102
- - lib/concurrent/executors.rb
103
- - lib/concurrent/future.rb
104
- - lib/concurrent/hash.rb
105
- - lib/concurrent/immutable_struct.rb
106
- - lib/concurrent/ivar.rb
107
- - lib/concurrent/lazy_register.rb
108
- - lib/concurrent/map.rb
109
- - lib/concurrent/maybe.rb
110
- - lib/concurrent/mutable_struct.rb
111
- - lib/concurrent/mvar.rb
112
- - lib/concurrent/options.rb
113
- - lib/concurrent/promise.rb
114
- - lib/concurrent/scheduled_task.rb
115
- - lib/concurrent/settable_struct.rb
116
- - lib/concurrent/synchronization.rb
117
- - lib/concurrent/synchronization/abstract_lockable_object.rb
118
- - lib/concurrent/synchronization/abstract_object.rb
119
- - lib/concurrent/synchronization/abstract_struct.rb
120
- - lib/concurrent/synchronization/condition.rb
121
- - lib/concurrent/synchronization/jruby_lockable_object.rb
122
- - lib/concurrent/synchronization/jruby_object.rb
123
- - lib/concurrent/synchronization/lock.rb
124
- - lib/concurrent/synchronization/lockable_object.rb
125
- - lib/concurrent/synchronization/mri_lockable_object.rb
126
- - lib/concurrent/synchronization/mri_object.rb
127
- - lib/concurrent/synchronization/object.rb
128
- - lib/concurrent/synchronization/rbx_lockable_object.rb
129
- - lib/concurrent/synchronization/rbx_object.rb
130
- - lib/concurrent/synchronization/truffle_lockable_object.rb
131
- - lib/concurrent/synchronization/truffle_object.rb
132
- - lib/concurrent/synchronization/volatile.rb
133
- - lib/concurrent/thread_safe/synchronized_delegator.rb
134
- - lib/concurrent/thread_safe/util.rb
135
- - lib/concurrent/thread_safe/util/adder.rb
136
- - lib/concurrent/thread_safe/util/array_hash_rbx.rb
137
- - lib/concurrent/thread_safe/util/cheap_lockable.rb
138
- - lib/concurrent/thread_safe/util/power_of_two_tuple.rb
139
- - lib/concurrent/thread_safe/util/striped64.rb
140
- - lib/concurrent/thread_safe/util/volatile.rb
141
- - lib/concurrent/thread_safe/util/xor_shift_random.rb
142
- - lib/concurrent/timer_task.rb
143
- - lib/concurrent/tuple.rb
144
- - lib/concurrent/tvar.rb
145
- - lib/concurrent/utility/at_exit.rb
146
- - lib/concurrent/utility/engine.rb
147
- - lib/concurrent/utility/monotonic_time.rb
148
- - lib/concurrent/utility/native_extension_loader.rb
149
- - lib/concurrent/utility/native_integer.rb
150
- - lib/concurrent/utility/processor_counter.rb
151
- - lib/concurrent/version.rb
30
+ - Rakefile
31
+ - ext/concurrent-ruby/ConcurrentRubyService.java
32
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/AtomicReferenceLibrary.java
33
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/JRubyMapBackendLibrary.java
34
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicBooleanLibrary.java
35
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicFixnumLibrary.java
36
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/JavaSemaphoreLibrary.java
37
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/SynchronizationLibrary.java
38
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMap.java
39
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java
40
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/LongAdder.java
41
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/Striped64.java
42
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java
43
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/LongAdder.java
44
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/Striped64.java
45
+ - ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166y/ThreadLocalRandom.java
46
+ - lib/concurrent-ruby/concurrent-ruby.rb
47
+ - lib/concurrent-ruby/concurrent.rb
48
+ - lib/concurrent-ruby/concurrent/agent.rb
49
+ - lib/concurrent-ruby/concurrent/array.rb
50
+ - lib/concurrent-ruby/concurrent/async.rb
51
+ - lib/concurrent-ruby/concurrent/atom.rb
52
+ - lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb
53
+ - lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb
54
+ - lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb
55
+ - lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb
56
+ - lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb
57
+ - lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb
58
+ - lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb
59
+ - lib/concurrent-ruby/concurrent/atomic/event.rb
60
+ - lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
61
+ - lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
62
+ - lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb
63
+ - lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb
64
+ - lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb
65
+ - lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb
66
+ - lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb
67
+ - lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb
68
+ - lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb
69
+ - lib/concurrent-ruby/concurrent/atomic/semaphore.rb
70
+ - lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb
71
+ - lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb
72
+ - lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb
73
+ - lib/concurrent-ruby/concurrent/atomics.rb
74
+ - lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb
75
+ - lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb
76
+ - lib/concurrent-ruby/concurrent/collection/java_non_concurrent_priority_queue.rb
77
+ - lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb
78
+ - lib/concurrent-ruby/concurrent/collection/map/atomic_reference_map_backend.rb
79
+ - lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb
80
+ - lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb
81
+ - lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb
82
+ - lib/concurrent-ruby/concurrent/collection/map/truffleruby_map_backend.rb
83
+ - lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb
84
+ - lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb
85
+ - lib/concurrent-ruby/concurrent/concern/deprecation.rb
86
+ - lib/concurrent-ruby/concurrent/concern/dereferenceable.rb
87
+ - lib/concurrent-ruby/concurrent/concern/logging.rb
88
+ - lib/concurrent-ruby/concurrent/concern/obligation.rb
89
+ - lib/concurrent-ruby/concurrent/concern/observable.rb
90
+ - lib/concurrent-ruby/concurrent/concurrent_ruby.jar
91
+ - lib/concurrent-ruby/concurrent/configuration.rb
92
+ - lib/concurrent-ruby/concurrent/constants.rb
93
+ - lib/concurrent-ruby/concurrent/dataflow.rb
94
+ - lib/concurrent-ruby/concurrent/delay.rb
95
+ - lib/concurrent-ruby/concurrent/errors.rb
96
+ - lib/concurrent-ruby/concurrent/exchanger.rb
97
+ - lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb
98
+ - lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb
99
+ - lib/concurrent-ruby/concurrent/executor/executor_service.rb
100
+ - lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb
101
+ - lib/concurrent-ruby/concurrent/executor/immediate_executor.rb
102
+ - lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb
103
+ - lib/concurrent-ruby/concurrent/executor/java_executor_service.rb
104
+ - lib/concurrent-ruby/concurrent/executor/java_single_thread_executor.rb
105
+ - lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb
106
+ - lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb
107
+ - lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb
108
+ - lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb
109
+ - lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb
110
+ - lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb
111
+ - lib/concurrent-ruby/concurrent/executor/serialized_execution.rb
112
+ - lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
113
+ - lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb
114
+ - lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb
115
+ - lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb
116
+ - lib/concurrent-ruby/concurrent/executor/timer_set.rb
117
+ - lib/concurrent-ruby/concurrent/executors.rb
118
+ - lib/concurrent-ruby/concurrent/future.rb
119
+ - lib/concurrent-ruby/concurrent/hash.rb
120
+ - lib/concurrent-ruby/concurrent/immutable_struct.rb
121
+ - lib/concurrent-ruby/concurrent/ivar.rb
122
+ - lib/concurrent-ruby/concurrent/map.rb
123
+ - lib/concurrent-ruby/concurrent/maybe.rb
124
+ - lib/concurrent-ruby/concurrent/mutable_struct.rb
125
+ - lib/concurrent-ruby/concurrent/mvar.rb
126
+ - lib/concurrent-ruby/concurrent/options.rb
127
+ - lib/concurrent-ruby/concurrent/promise.rb
128
+ - lib/concurrent-ruby/concurrent/promises.rb
129
+ - lib/concurrent-ruby/concurrent/re_include.rb
130
+ - lib/concurrent-ruby/concurrent/scheduled_task.rb
131
+ - lib/concurrent-ruby/concurrent/set.rb
132
+ - lib/concurrent-ruby/concurrent/settable_struct.rb
133
+ - lib/concurrent-ruby/concurrent/synchronization.rb
134
+ - lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb
135
+ - lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb
136
+ - lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb
137
+ - lib/concurrent-ruby/concurrent/synchronization/condition.rb
138
+ - lib/concurrent-ruby/concurrent/synchronization/jruby_lockable_object.rb
139
+ - lib/concurrent-ruby/concurrent/synchronization/jruby_object.rb
140
+ - lib/concurrent-ruby/concurrent/synchronization/lock.rb
141
+ - lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb
142
+ - lib/concurrent-ruby/concurrent/synchronization/mri_object.rb
143
+ - lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb
144
+ - lib/concurrent-ruby/concurrent/synchronization/object.rb
145
+ - lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb
146
+ - lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb
147
+ - lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb
148
+ - lib/concurrent-ruby/concurrent/synchronization/volatile.rb
149
+ - lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb
150
+ - lib/concurrent-ruby/concurrent/thread_safe/util.rb
151
+ - lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb
152
+ - lib/concurrent-ruby/concurrent/thread_safe/util/cheap_lockable.rb
153
+ - lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb
154
+ - lib/concurrent-ruby/concurrent/thread_safe/util/power_of_two_tuple.rb
155
+ - lib/concurrent-ruby/concurrent/thread_safe/util/striped64.rb
156
+ - lib/concurrent-ruby/concurrent/thread_safe/util/volatile.rb
157
+ - lib/concurrent-ruby/concurrent/thread_safe/util/xor_shift_random.rb
158
+ - lib/concurrent-ruby/concurrent/timer_task.rb
159
+ - lib/concurrent-ruby/concurrent/tuple.rb
160
+ - lib/concurrent-ruby/concurrent/tvar.rb
161
+ - lib/concurrent-ruby/concurrent/utility/engine.rb
162
+ - lib/concurrent-ruby/concurrent/utility/monotonic_time.rb
163
+ - lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb
164
+ - lib/concurrent-ruby/concurrent/utility/native_integer.rb
165
+ - lib/concurrent-ruby/concurrent/utility/processor_counter.rb
166
+ - lib/concurrent-ruby/concurrent/version.rb
152
167
  homepage: http://www.concurrent-ruby.com
153
168
  licenses:
154
169
  - MIT
155
- metadata: {}
156
- post_install_message:
170
+ metadata:
171
+ source_code_uri: https://github.com/ruby-concurrency/concurrent-ruby
172
+ changelog_uri: https://github.com/ruby-concurrency/concurrent-ruby/blob/master/CHANGELOG.md
173
+ post_install_message:
157
174
  rdoc_options: []
158
175
  require_paths:
159
- - lib
176
+ - lib/concurrent-ruby
160
177
  required_ruby_version: !ruby/object:Gem::Requirement
161
178
  requirements:
162
179
  - - ">="
163
180
  - !ruby/object:Gem::Version
164
- version: 1.9.3
181
+ version: '2.2'
165
182
  required_rubygems_version: !ruby/object:Gem::Requirement
166
183
  requirements:
167
184
  - - ">="
168
185
  - !ruby/object:Gem::Version
169
186
  version: '0'
170
187
  requirements: []
171
- rubyforge_project:
172
- rubygems_version: 2.6.8
173
- signing_key:
188
+ rubygems_version: 3.3.4
189
+ signing_key:
174
190
  specification_version: 4
175
191
  summary: Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell,
176
192
  F#, C#, Java, and classic concurrency patterns.
177
193
  test_files: []
178
- has_rdoc:
@@ -1,39 +0,0 @@
1
- require 'concurrent/utility/engine'
2
- require 'concurrent/thread_safe/util'
3
-
4
- module Concurrent
5
- if Concurrent.on_cruby?
6
-
7
- # Because MRI never runs code in parallel, the existing
8
- # non-thread-safe structures should usually work fine.
9
-
10
- # @!macro [attach] concurrent_array
11
- #
12
- # A thread-safe subclass of Array. This version locks against the object
13
- # itself for every method call, ensuring only one thread can be reading
14
- # or writing at a time. This includes iteration methods like `#each`.
15
- #
16
- # @see http://ruby-doc.org/core-2.2.0/Array.html Ruby standard library `Array`
17
- class Array < ::Array;
18
- end
19
-
20
- elsif Concurrent.on_jruby?
21
- require 'jruby/synchronized'
22
-
23
- # @!macro concurrent_array
24
- class Array < ::Array
25
- include JRuby::Synchronized
26
- end
27
-
28
- elsif Concurrent.on_rbx? || Concurrent.on_truffle?
29
- require 'monitor'
30
- require 'concurrent/thread_safe/util/array_hash_rbx'
31
-
32
- # @!macro concurrent_array
33
- class Array < ::Array
34
- end
35
-
36
- ThreadSafe::Util.make_synchronized_on_rbx Array
37
- end
38
- end
39
-