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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a60be6dec008167a29f42577f31c869f60d2546b
4
- data.tar.gz: 37bf185108dd03a4e4f2101f97fc326e2bafa892
3
+ metadata.gz: 2df54b46637b1720489c08aa6b931bffc16af264
4
+ data.tar.gz: 219d571a3e3c83b2609b62f73539a9831521ecc9
5
5
  SHA512:
6
- metadata.gz: 3ed4f2c8f8cf8ac4c05a87b6a489f5f89ad0e4d28dbe2ab9e272135557eb006f1b235cc1597b6c6540edf383a63e11f60bd25d0cfa047bc4a4fe9aa3d9ab56d4
7
- data.tar.gz: 84c54fb9a82577f71a444c55ebac7893f4192273c567b742bffb44256e8b53a4669e9437c63373180f0e1d09b174be6a6b84435e710ffa057adcd486c3a77c5c
6
+ metadata.gz: 981de5d244c6a5d46b6b0d54a45de34a75034b896b5fa7f39e4fc6d56c059747f8471dc78010714a7c2ef615d9db4c9ae1e51fc27695fc7c1db079f23eba9eb8
7
+ data.tar.gz: a046e7de8b9b4dde59cbfe62966a471c9b3127f8c55188207c540752d1b76de07488145d08dcaab5edba308fe7d97479de0ccd617b3a9c8f194a6944775feb95
@@ -1,4 +1,20 @@
1
- ## Current Release v1.0.4 (27 Dec 2016)
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, state. Based on Clojure's [Agent](http://clojure.org/agents).
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.
@@ -15,7 +15,9 @@ module Concurrent
15
15
 
16
16
  if block_given?
17
17
  @default_block = default_block
18
+ @default = nil
18
19
  else
20
+ @default_block = nil
19
21
  @default = default
20
22
  end
21
23
 
@@ -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, get
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
@@ -46,4 +46,6 @@ class Concurrent::AtomicReference
46
46
  def to_s
47
47
  format '<#%s:0x%x value:%s>', self.class, object_id << 1, get
48
48
  end
49
+
50
+ alias_method :inspect, :to_s
49
51
  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
@@ -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
@@ -1,5 +1,6 @@
1
1
  module Concurrent
2
2
  module Synchronization
3
+ # TODO (pitr-ch 04-Dec-2016): should be in edge
3
4
  class Lock < LockableObject
4
5
  # TODO use JavaReentrantLock on JRuby
5
6
 
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Concurrent
2
- VERSION = '1.0.4'
3
- EDGE_VERSION = '0.3.0'
2
+ VERSION = '1.0.5'
3
+ EDGE_VERSION = '0.3.1'
4
4
  end
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
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: 2016-12-27 00:00:00.000000000 Z
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: