concurrent-ruby 1.0.4-java → 1.0.5-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -1
- data/README.md +1 -1
- data/lib/concurrent/atomic/abstract_thread_local_var.rb +2 -0
- data/lib/concurrent/atomic/atomic_boolean.rb +6 -0
- data/lib/concurrent/atomic/atomic_fixnum.rb +3 -1
- data/lib/concurrent/atomic/atomic_reference.rb +2 -0
- data/lib/concurrent/atomic/event.rb +20 -0
- data/lib/concurrent/atomic/semaphore.rb +32 -0
- data/lib/concurrent/edge.rb +0 -4
- data/lib/concurrent/synchronization/condition.rb +3 -0
- data/lib/concurrent/synchronization/lock.rb +1 -0
- data/lib/concurrent/synchronization/object.rb +1 -0
- data/lib/concurrent/version.rb +2 -2
- data/lib/concurrent_ruby_ext.jar +0 -0
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2df54b46637b1720489c08aa6b931bffc16af264
|
4
|
+
data.tar.gz: 219d571a3e3c83b2609b62f73539a9831521ecc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 981de5d244c6a5d46b6b0d54a45de34a75034b896b5fa7f39e4fc6d56c059747f8471dc78010714a7c2ef615d9db4c9ae1e51fc27695fc7c1db079f23eba9eb8
|
7
|
+
data.tar.gz: a046e7de8b9b4dde59cbfe62966a471c9b3127f8c55188207c540752d1b76de07488145d08dcaab5edba308fe7d97479de0ccd617b3a9c8f194a6944775feb95
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,20 @@
|
|
1
|
-
##
|
1
|
+
## Release v1.0.5, edge v0.3.1 (26 Feb 2017)
|
2
|
+
|
3
|
+
concurrent-ruby:
|
4
|
+
|
5
|
+
* Documentation for Event and Semaphore
|
6
|
+
* Use Unsafe#fullFence and #loadFence directly since the shortcuts were removed in JRuby
|
7
|
+
* Do not depend on org.jruby.util.unsafe.UnsafeHolder
|
8
|
+
|
9
|
+
concurrent-ruby-edge:
|
10
|
+
|
11
|
+
* (#620) Actors on Pool raise an error
|
12
|
+
* (#624) Delayed promises did not interact correctly with flatting
|
13
|
+
* Fix arguments yielded by callback methods
|
14
|
+
* Overridable default executor in promises factory methods
|
15
|
+
* Asking actor to terminate will always resolve to `true`
|
16
|
+
|
17
|
+
## Release v1.0.4, edge v0.3.0 (27 Dec 2016)
|
2
18
|
|
3
19
|
concurrent-ruby:
|
4
20
|
|
data/README.md
CHANGED
@@ -84,7 +84,7 @@ Structure classes derived from Ruby's [Struct](http://ruby-doc.org/core-2.2.0/St
|
|
84
84
|
|
85
85
|
Thread-safe variables:
|
86
86
|
|
87
|
-
* [Agent](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Agent.html): A way to manage shared, mutable, *asynchronous*, independent
|
87
|
+
* [Agent](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Agent.html): A way to manage shared, mutable, *asynchronous*, independent state. Based on Clojure's [Agent](http://clojure.org/agents).
|
88
88
|
* [Atom](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Atom.html): A way to manage shared, mutable, *synchronous*, independent state. Based on Clojure's [Atom](http://clojure.org/atoms).
|
89
89
|
* [AtomicBoolean](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicBoolean.html) A boolean value that can be updated atomically.
|
90
90
|
* [AtomicFixnum](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicFixnum.html) A numeric value that can be updated atomically.
|
@@ -112,5 +112,11 @@ module Concurrent
|
|
112
112
|
#
|
113
113
|
# @!macro atomic_boolean_public_api
|
114
114
|
class AtomicBoolean < AtomicBooleanImplementation
|
115
|
+
# @return [String] Short string representation.
|
116
|
+
def to_s
|
117
|
+
format '<#%s:0x%x value:%s>', self.class, object_id << 1, value
|
118
|
+
end
|
119
|
+
|
120
|
+
alias_method :inspect, :to_s
|
115
121
|
end
|
116
122
|
end
|
@@ -131,7 +131,9 @@ module Concurrent
|
|
131
131
|
class AtomicFixnum < AtomicFixnumImplementation
|
132
132
|
# @return [String] Short string representation.
|
133
133
|
def to_s
|
134
|
-
format '<#%s:0x%x value:%s>', self.class, object_id << 1,
|
134
|
+
format '<#%s:0x%x value:%s>', self.class, object_id << 1, value
|
135
135
|
end
|
136
|
+
|
137
|
+
alias_method :inspect, :to_s
|
136
138
|
end
|
137
139
|
end
|
@@ -13,6 +13,26 @@ module Concurrent
|
|
13
13
|
# `#reset` at any time once it has been set.
|
14
14
|
#
|
15
15
|
# @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682655.aspx
|
16
|
+
# @example
|
17
|
+
# event = Concurrent::Event.new
|
18
|
+
#
|
19
|
+
# t1 = Thread.new do
|
20
|
+
# puts "t1 is waiting"
|
21
|
+
# event.wait(1)
|
22
|
+
# puts "event ocurred"
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# t2 = Thread.new do
|
26
|
+
# puts "t2 calling set"
|
27
|
+
# event.set
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# [t1, t2].each(&:join)
|
31
|
+
#
|
32
|
+
# # prints:
|
33
|
+
# # t2 calling set
|
34
|
+
# # t1 is waiting
|
35
|
+
# # event ocurred
|
16
36
|
class Event < Synchronization::LockableObject
|
17
37
|
|
18
38
|
# Creates a new `Event` in the unset state. Threads calling `#wait` on the
|
@@ -108,6 +108,38 @@ module Concurrent
|
|
108
108
|
# count of the number available and acts accordingly.
|
109
109
|
#
|
110
110
|
# @!macro semaphore_public_api
|
111
|
+
# @example
|
112
|
+
# semaphore = Concurrent::Semaphore.new(2)
|
113
|
+
#
|
114
|
+
# t1 = Thread.new do
|
115
|
+
# semaphore.acquire
|
116
|
+
# puts "Thread 1 acquired semaphore"
|
117
|
+
# end
|
118
|
+
#
|
119
|
+
# t2 = Thread.new do
|
120
|
+
# semaphore.acquire
|
121
|
+
# puts "Thread 2 acquired semaphore"
|
122
|
+
# end
|
123
|
+
#
|
124
|
+
# t3 = Thread.new do
|
125
|
+
# semaphore.acquire
|
126
|
+
# puts "Thread 3 acquired semaphore"
|
127
|
+
# end
|
128
|
+
#
|
129
|
+
# t4 = Thread.new do
|
130
|
+
# sleep(2)
|
131
|
+
# puts "Thread 4 releasing semaphore"
|
132
|
+
# semaphore.release
|
133
|
+
# end
|
134
|
+
#
|
135
|
+
# [t1, t2, t3, t4].each(&:join)
|
136
|
+
#
|
137
|
+
# # prints:
|
138
|
+
# # Thread 3 acquired semaphore
|
139
|
+
# # Thread 2 acquired semaphore
|
140
|
+
# # Thread 4 releasing semaphore
|
141
|
+
# # Thread 1 acquired semaphore
|
142
|
+
#
|
111
143
|
class Semaphore < SemaphoreImplementation
|
112
144
|
end
|
113
145
|
end
|
data/lib/concurrent/edge.rb
CHANGED
@@ -15,10 +15,6 @@ module Concurrent
|
|
15
15
|
# features should remain in this module until merged into the core gem. This
|
16
16
|
# will prevent namespace collisions.
|
17
17
|
#
|
18
|
-
# This file should *never* be used as a global `require` for all files within
|
19
|
-
# the edge gem. Because these features are experimental users should always
|
20
|
-
# explicitly require only what they need.
|
21
|
-
#
|
22
18
|
# @!macro [attach] edge_warning
|
23
19
|
# @api Edge
|
24
20
|
# @note **Edge Feature:** Edge features are under active development and may change frequently. They are expected not to
|
@@ -1,9 +1,12 @@
|
|
1
1
|
module Concurrent
|
2
2
|
module Synchronization
|
3
|
+
# TODO (pitr-ch 04-Dec-2016): should be in edge
|
3
4
|
class Condition < LockableObject
|
4
5
|
safe_initialization!
|
5
6
|
|
6
7
|
# TODO (pitr 12-Sep-2015): locks two objects, improve
|
8
|
+
# TODO (pitr 26-Sep-2015): study
|
9
|
+
# http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#AbstractQueuedSynchronizer.Node
|
7
10
|
|
8
11
|
singleton_class.send :alias_method, :private_new, :new
|
9
12
|
private_class_method :new
|
@@ -22,6 +22,7 @@ module Concurrent
|
|
22
22
|
# - volatile instance variables see {Object.attr_volatile}
|
23
23
|
# - volatile instance variables see {Object.attr_atomic}
|
24
24
|
class Object < ObjectImplementation
|
25
|
+
# TODO make it a module if possible
|
25
26
|
|
26
27
|
# @!method self.attr_volatile(*names)
|
27
28
|
# Creates methods for reading and writing (as `attr_accessor` does) to a instance variable with
|
data/lib/concurrent/version.rb
CHANGED
data/lib/concurrent_ruby_ext.jar
CHANGED
Binary file
|
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.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Jerry D'Antonio
|
@@ -10,14 +10,12 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2017-02-26 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.
|
17
17
|
Inspired by Erlang, Clojure, Go, JavaScript, actors, and classic concurrency patterns.
|
18
|
-
email:
|
19
|
-
- jerry.dantonio@gmail.com
|
20
|
-
- concurrent-ruby@googlegroups.com
|
18
|
+
email: concurrent-ruby@googlegroups.com
|
21
19
|
executables: []
|
22
20
|
extensions: []
|
23
21
|
extra_rdoc_files:
|