concurrent-ruby 1.0.0.pre4 → 1.0.0.pre5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -1
  3. data/lib/concurrent/agent.rb +5 -1
  4. data/lib/concurrent/async.rb +77 -38
  5. data/lib/concurrent/atom.rb +2 -1
  6. data/lib/concurrent/atomic/atomic_boolean.rb +1 -1
  7. data/lib/concurrent/atomic/atomic_fixnum.rb +1 -1
  8. data/lib/concurrent/atomic/atomic_reference.rb +1 -1
  9. data/lib/concurrent/atomic/semaphore.rb +1 -1
  10. data/lib/concurrent/atomic_reference/jruby+truffle.rb +1 -0
  11. data/lib/concurrent/atomic_reference/jruby.rb +1 -1
  12. data/lib/concurrent/atomic_reference/ruby.rb +1 -1
  13. data/lib/concurrent/concern/dereferenceable.rb +9 -24
  14. data/lib/concurrent/concern/obligation.rb +11 -8
  15. data/lib/concurrent/delay.rb +1 -1
  16. data/lib/concurrent/exchanger.rb +30 -17
  17. data/lib/concurrent/executor/ruby_thread_pool_executor.rb +6 -1
  18. data/lib/concurrent/ivar.rb +1 -1
  19. data/lib/concurrent/lazy_register.rb +11 -8
  20. data/lib/concurrent/map.rb +1 -1
  21. data/lib/concurrent/maybe.rb +6 -3
  22. data/lib/concurrent/mvar.rb +26 -2
  23. data/lib/concurrent/promise.rb +1 -1
  24. data/lib/concurrent/synchronization.rb +3 -0
  25. data/lib/concurrent/synchronization/abstract_lockable_object.rb +1 -20
  26. data/lib/concurrent/synchronization/abstract_object.rb +1 -27
  27. data/lib/concurrent/synchronization/jruby_object.rb +26 -18
  28. data/lib/concurrent/synchronization/lockable_object.rb +29 -16
  29. data/lib/concurrent/synchronization/mri_object.rb +27 -19
  30. data/lib/concurrent/synchronization/object.rb +48 -53
  31. data/lib/concurrent/synchronization/rbx_lockable_object.rb +9 -8
  32. data/lib/concurrent/synchronization/rbx_object.rb +29 -21
  33. data/lib/concurrent/synchronization/volatile.rb +34 -0
  34. data/lib/concurrent/timer_task.rb +0 -1
  35. data/lib/concurrent/tvar.rb +3 -1
  36. data/lib/concurrent/utility/engine.rb +4 -0
  37. data/lib/concurrent/utility/native_extension_loader.rb +6 -3
  38. data/lib/concurrent/version.rb +2 -2
  39. metadata +4 -2
@@ -19,6 +19,10 @@ module Concurrent
19
19
  ruby_engine == 'rbx'
20
20
  end
21
21
 
22
+ def on_truffle?
23
+ ruby_engine == 'jruby+truffle'
24
+ end
25
+
22
26
  def on_windows?
23
27
  !(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/).nil?
24
28
  end
@@ -1,7 +1,7 @@
1
- require 'concurrent/synchronization/abstract_object' # must be loaded before JRuby extensions
2
1
  require 'concurrent/utility/engine'
3
2
 
4
3
  module Concurrent
4
+
5
5
  module Utility
6
6
 
7
7
  # @!visibility private
@@ -28,6 +28,10 @@ module Concurrent
28
28
  end
29
29
 
30
30
  def load_native_extensions
31
+ unless defined? Synchronization::AbstractObject
32
+ raise 'native_extension_loader loaded before Synchronization::AbstractObject'
33
+ end
34
+
31
35
  if Concurrent.on_cruby? && !c_extensions_loaded?
32
36
  tries = [
33
37
  lambda do
@@ -56,7 +60,7 @@ module Concurrent
56
60
  set_java_extensions_loaded
57
61
  rescue LoadError
58
62
  # move on with pure-Ruby implementations
59
- warn 'On JRuby but Java extensions failed to load.'
63
+ raise 'On JRuby but Java extensions failed to load.'
60
64
  end
61
65
  end
62
66
  end
@@ -67,4 +71,3 @@ module Concurrent
67
71
  extend Utility::NativeExtensionLoader
68
72
  end
69
73
 
70
- Concurrent.load_native_extensions
@@ -1,4 +1,4 @@
1
1
  module Concurrent
2
- VERSION = '1.0.0.pre4'
3
- EDGE_VERSION = '0.2.0.pre4'
2
+ VERSION = '1.0.0.pre5'
3
+ EDGE_VERSION = '0.2.0.pre5'
4
4
  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.0.0.pre4
4
+ version: 1.0.0.pre5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry D'Antonio
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-08 00:00:00.000000000 Z
12
+ date: 2015-11-04 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: |
15
15
  Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
@@ -52,6 +52,7 @@ files:
52
52
  - lib/concurrent/atomic/thread_local_var.rb
53
53
  - lib/concurrent/atomic_reference/concurrent_update_error.rb
54
54
  - lib/concurrent/atomic_reference/direct_update.rb
55
+ - lib/concurrent/atomic_reference/jruby+truffle.rb
55
56
  - lib/concurrent/atomic_reference/jruby.rb
56
57
  - lib/concurrent/atomic_reference/mutex_atomic.rb
57
58
  - lib/concurrent/atomic_reference/numeric_cas_wrapper.rb
@@ -127,6 +128,7 @@ files:
127
128
  - lib/concurrent/synchronization/object.rb
128
129
  - lib/concurrent/synchronization/rbx_lockable_object.rb
129
130
  - lib/concurrent/synchronization/rbx_object.rb
131
+ - lib/concurrent/synchronization/volatile.rb
130
132
  - lib/concurrent/thread_safe/synchronized_delegator.rb
131
133
  - lib/concurrent/thread_safe/util.rb
132
134
  - lib/concurrent/thread_safe/util/adder.rb