concurrent-ruby-ext 0.9.0.pre2-x64-mingw32 → 0.9.0.pre3-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzZmZTc4MjcyYWRiZmYzMGY5ZmI2YzRmOWZlMDg4OGYyYjYyNTA3Yg==
4
+ M2YwZGMyZGUzNWJlYjJmZDQ0MjFkMDY5OGVlYjkwN2E4NTdlNTNlNw==
5
5
  data.tar.gz: !binary |-
6
- NTBhMDMzMzkyY2JlZTVhMWE0MjE0ZjkyYTBjMjI5ODYwNTVhYjZmNg==
6
+ YmFjZTdkNjU2Nzc4M2JhNzhkOGY1ODlkNGE1NjNjMjM4YWVjYTY2ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGYzOWU1NWFmZmFjZWJkMGM3N2UxZGEyNGZiOGFlYmUxY2E0NWZjMWRlYzRm
10
- ODE5OTI2NDRmYzg0ZDFjZjVjOWU0ODNmYWU1OTJhODUxZWMwZTU3MzUzMTRh
11
- MTFhNzAzNTE2Nzg2ZmE1Mzg1YzgzOTdlNmM4YTVkMzNhNzAxMGQ=
9
+ MWRjMDg1NDllZmFhNDhiNGZkZjg0Zjc5YTNhMWE3YTY1MTZmMjIxZmJjZDcy
10
+ MTNmOWExMWMwZDBjNzQ2OWVjNjcyYzI0ZjRhNTNkZTE5NmM3Njk5ODAzYWI0
11
+ ZDY0ZWQyYWZlZjI3MDhiYTY2N2Q2MjNjOThhZGZkNjVmYjVkMjQ=
12
12
  data.tar.gz: !binary |-
13
- ZWRmMTA3YTMwMGNiODY5MGM5YTg0ZjgyNDZkYjQwMjU2YmQ4M2MxNmU5NWMz
14
- NmJkNmEzMjczNzM1YTZlNmM3ZjA5Y2I0NGZkMDU5YjA3NzdiMzI1ZGNhMjZm
15
- YWNiZmVkNmY2ZWE5ZGFkN2E0NjU4MmRlMjg3OWQxYzllNDg0OTg=
13
+ MjA0MzlmZTAyOTI3Yzg1ZTM5MWFhODFkNThmNjM3YTFiNzY3OTQ5ODViOWMx
14
+ ZmFjYWYwZjVjNGNlZjI4NjYyNzZjZWZkOTFmNWRjOGJlMWNjMjllZjBhMzQx
15
+ MDUwYTQ5ZjU1ZTdlMTk1NzdhYmM4NzJmZGY3ZmU4ZTc3ODgxYzk=
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ### Next Release v0.9.0 (Target Date: 7 June 2015)
2
2
 
3
+
4
+ * Updated `AtomicReference`
5
+ - `AtomicReference#try_update` now simply returns instead of raising exception
6
+ - `AtomicReference#try_update!` was added to raise exceptions if an update
7
+ fails. Note: this is the same behavior as the old `try_update`
3
8
  * Pure Java implementations of
4
9
  - `AtomicBoolean`
5
10
  - `AtomicFixnum`
@@ -58,7 +63,7 @@
58
63
  - `Channel`
59
64
  - `Exchanger`
60
65
  - `LazyRegister`
61
- - **new Future Framework** <http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge.html> - unified
66
+ - **new Future Framework** <http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge.html> - unified
62
67
  implementation of Futures and Promises which combines Features of previous `Future`,
63
68
  `Promise`, `IVar`, `Event`, `Probe`, `dataflow`, `Delay`, `TimerTask` into single framework. It uses extensively
64
69
  new synchronization layer to make all the paths **lock-free** with exception of blocking threads on `#wait`.
@@ -80,7 +85,7 @@
80
85
  - Add AbstractContext#default_executor to be able to override executor class wide
81
86
  - Add basic IO example
82
87
  - Documentation somewhat improved
83
- - All messages should have same priority. It's now possible to send `actor << job1 << job2 << :terminate!` and
88
+ - All messages should have same priority. It's now possible to send `actor << job1 << job2 << :terminate!` and
84
89
  be sure that both jobs are processed first.
85
90
  * Refactored `Channel` to use newer synchronization objects
86
91
  * Added `#reset` and `#cancel` methods to `TimerSet`
@@ -162,7 +167,7 @@ Please see the [roadmap](https://github.com/ruby-concurrency/concurrent-ruby/iss
162
167
  - `SerializedExecutionDelegator` for serializing *any* executor
163
168
  * Updated `Async` with serialized execution
164
169
  * Updated `ImmediateExecutor` and `PerThreadExecutor` with full executor service lifecycle
165
- * Added a `Delay` to root `Actress` initialization
170
+ * Added a `Delay` to root `Actress` initialization
166
171
  * Minor bug fixes to thread pools
167
172
  * Refactored many intermittently failing specs
168
173
  * Removed Java interop warning `executor.rb:148 warning: ambiguous Java methods found, using submit(java.lang.Runnable)`
@@ -1,5 +1,6 @@
1
1
  require 'fileutils'
2
2
 
3
+ $:.unshift(File.expand_path('../../../lib', __FILE__))
3
4
  require 'concurrent/utility/native_extension_loader'
4
5
 
5
6
  EXTENSION_NAME = 'extension'
Binary file
@@ -13,7 +13,7 @@ module Concurrent
13
13
  # Pass the current value to the given block, replacing it
14
14
  # with the block's result. May retry if the value changes
15
15
  # during the block's execution.
16
- #
16
+ #
17
17
  # @yield [Object] Calculate a new value for the atomic reference using
18
18
  # given (old) value
19
19
  # @yieldparam [Object] old_value the starting value of the atomic reference
@@ -27,17 +27,45 @@ module Concurrent
27
27
  # @!macro [attach] atomic_reference_method_try_update
28
28
  #
29
29
  # Pass the current value to the given block, replacing it
30
+ # with the block's result. Return nil if the update fails.
31
+ #
32
+ # @yield [Object] Calculate a new value for the atomic reference using
33
+ # given (old) value
34
+ # @yieldparam [Object] old_value the starting value of the atomic reference
35
+ #
36
+ # @note This method was altered to avoid raising an exception by default.
37
+ # Instead, this method now returns `nil` in case of failure. For more info,
38
+ # please see: https://github.com/ruby-concurrency/concurrent-ruby/pull/336
39
+ #
40
+ # @return [Object] the new value, or nil if update failed
41
+ def try_update
42
+ old_value = get
43
+ new_value = yield old_value
44
+
45
+ return unless compare_and_set old_value, new_value
46
+
47
+ new_value
48
+ end
49
+
50
+ # @!macro [attach] atomic_reference_method_try_update!
51
+ #
52
+ # Pass the current value to the given block, replacing it
30
53
  # with the block's result. Raise an exception if the update
31
54
  # fails.
32
- #
55
+ #
33
56
  # @yield [Object] Calculate a new value for the atomic reference using
34
57
  # given (old) value
35
58
  # @yieldparam [Object] old_value the starting value of the atomic reference
36
59
  #
60
+ # @note This behavior mimics the behavior of the original
61
+ # `AtomicReference#try_update` API. The reason this was changed was to
62
+ # avoid raising exceptions (which are inherently slow) by default. For more
63
+ # info: https://github.com/ruby-concurrency/concurrent-ruby/pull/336
64
+ #
37
65
  # @return [Object] the new value
38
66
  #
39
67
  # @raise [Concurrent::ConcurrentUpdateError] if the update fails
40
- def try_update
68
+ def try_update!
41
69
  old_value = get
42
70
  new_value = yield old_value
43
71
  unless compare_and_set(old_value, new_value)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concurrent-ruby-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.pre2
4
+ version: 0.9.0.pre3
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Jerry D'Antonio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.0.pre2
19
+ version: 0.9.0.pre3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.0.pre2
26
+ version: 0.9.0.pre3
27
27
  description: ! " C extensions to optimize the concurrent-ruby gem when running
28
28
  under MRI.\n Please see http://concurrent-ruby.com for more information.\n"
29
29
  email: jerry.dantonio@gmail.com
@@ -47,7 +47,6 @@ files:
47
47
  - ext/concurrent/rb_concurrent.c
48
48
  - ext/concurrent/ruby_193_compatible.h
49
49
  - lib/concurrent/2.0/extension.so
50
- - lib/concurrent/2.1/extension.so
51
50
  - lib/concurrent/atomic_reference/concurrent_update_error.rb
52
51
  - lib/concurrent/atomic_reference/direct_update.rb
53
52
  - lib/concurrent/atomic_reference/numeric_cas_wrapper.rb
@@ -72,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
71
  version: 1.3.1
73
72
  requirements: []
74
73
  rubyforge_project:
75
- rubygems_version: 2.4.7
74
+ rubygems_version: 2.4.8
76
75
  signing_key:
77
76
  specification_version: 4
78
77
  summary: C extensions to optimize concurrent-ruby under MRI.
Binary file