concurrent-ruby 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3db57904f9a4906ae01e04d1873aa824992ed1b4258d2b2523ba5ea0ca86b17f
4
- data.tar.gz: d8bfd56f2c29b311e528754ee1db476ecbb6387ac7f05a63bb5e395877379452
3
+ metadata.gz: 207cadfd4ec0e25f6ba9881ef8f32ea86c5772074d4aff5e2ab5d5bdf4613e09
4
+ data.tar.gz: b41c0dd080a6d2fbf1d2c97bf2e9a8db0e99849ba875d32ade39384838e20e23
5
5
  SHA512:
6
- metadata.gz: b76f7f31795dce80951ea7b5231d919aa28384d04fe6591c43e310774450f16b074ce5536ef218fd2475f5413cdf0c9409bc1d3542b19b78146cc5375c30a603
7
- data.tar.gz: 9bb9d431f6995bdec6e7ed6c6323f72ac0cc713d71072115c0dfcefb6ccb42c8b5b703bf34049071bebf4e0686dce2e28cc44865329884785eae8a6a2eabd060
6
+ metadata.gz: 4edf0b84df6aa42a69c6ff231c730d12a64df6819ebea508599b469d88951c47ce4b091d3f3fc41afcb9196986091efe57d156161510f03cfb8ee0ebaf66ff0c
7
+ data.tar.gz: a18c3ef751cadd220d424779e96d96ead76362ad4e7bfcfb2341d9ba4baed6f0b8427c452e31868e512ab2b3a8226fe350041e0e5b87cd28e10d9ce1b5334c72
@@ -1,5 +1,10 @@
1
1
  ## Current
2
2
 
3
+ ## Release v1.1.8 (20 January 2021)
4
+
5
+ * (#885) Fix race condition in TVar for stale reads
6
+ * (#884) RubyThreadLocalVar: Do not iterate over hash which might conflict with new pair addition
7
+
3
8
  ## Release v1.1.7 (6 August 2020)
4
9
 
5
10
  concurrent-ruby:
data/Rakefile CHANGED
@@ -49,7 +49,9 @@ namespace :repackage do
49
49
  Rake::Task['lib/concurrent-ruby/concurrent/concurrent_ruby.jar'].invoke
50
50
 
51
51
  # build all gem files
52
- RakeCompilerDock.sh 'bundle install --local && bundle exec rake cross native package --trace'
52
+ %w[x86-mingw32 x64-mingw32].each do |plat|
53
+ RakeCompilerDock.sh "bundle install --local && bundle exec rake native:#{plat} gem --trace", platform: plat
54
+ end
53
55
  end
54
56
  end
55
57
  end
@@ -302,7 +304,7 @@ namespace :release do
302
304
  end
303
305
 
304
306
  desc '** tag HEAD with current version and push to github'
305
- task :tag do
307
+ task :tag => :ask do
306
308
  Dir.chdir(__dir__) do
307
309
  sh "git tag v#{Concurrent::VERSION}"
308
310
  sh "git push origin v#{Concurrent::VERSION}"
@@ -312,7 +314,7 @@ namespace :release do
312
314
  end
313
315
 
314
316
  desc '** push all *.gem files to rubygems'
315
- task :rubygems do
317
+ task :rubygems => :ask do
316
318
  Dir.chdir(__dir__) do
317
319
  sh "gem push pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
318
320
  sh "gem push pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem" if publish_edge
@@ -97,7 +97,10 @@ module Concurrent
97
97
  # The cost of GC'ing a TLV is linear in the number of threads using TLVs
98
98
  # But that is natural! More threads means more storage is used per TLV
99
99
  # So naturally more CPU time is required to free more storage
100
- THREAD_LOCAL_ARRAYS.each_value { |array| array[index] = nil }
100
+ #
101
+ # DO NOT use each_value which might conflict with new pair assignment
102
+ # into the hash in #value= method
103
+ THREAD_LOCAL_ARRAYS.values.each { |array| array[index] = nil }
101
104
  # free index has to be published after the arrays are cleared
102
105
  FREE.push(index)
103
106
  end
@@ -188,7 +188,10 @@ module Concurrent
188
188
  def write(tvar, value)
189
189
  # Have we already written to this TVar?
190
190
 
191
- unless @write_log.has_key? tvar
191
+ if @write_log.has_key? tvar
192
+ # Record the value written
193
+ @write_log[tvar] = value
194
+ else
192
195
  # Try to lock the TVar
193
196
 
194
197
  unless tvar.unsafe_lock.try_lock
@@ -196,7 +199,11 @@ module Concurrent
196
199
  Concurrent::abort_transaction
197
200
  end
198
201
 
199
- # If we previously wrote to it, check the version hasn't changed
202
+ # Record the value written
203
+
204
+ @write_log[tvar] = value
205
+
206
+ # If we previously read from it, check the version hasn't changed
200
207
 
201
208
  @read_log.each do |log_entry|
202
209
  if log_entry.tvar == tvar and tvar.unsafe_version > log_entry.version
@@ -204,10 +211,6 @@ module Concurrent
204
211
  end
205
212
  end
206
213
  end
207
-
208
- # Record the value written
209
-
210
- @write_log[tvar] = value
211
214
  end
212
215
 
213
216
  def abort
@@ -1,3 +1,3 @@
1
1
  module Concurrent
2
- VERSION = '1.1.7'
2
+ VERSION = '1.1.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concurrent-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry D'Antonio
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-08-08 00:00:00.000000000 Z
13
+ date: 2021-01-20 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.
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubygems_version: 3.1.2
187
+ rubygems_version: 3.2.3
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell,