thread 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thread/delay.rb +3 -3
- data/thread.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acd751cb226565073139b06c1ca6594027b8b62e
|
4
|
+
data.tar.gz: 2a7a2de127998b53448104cd363349baba61506b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ba38b474c1c8571a48f651d7c78543dcb71b10ab5dfa0b44a312962b2d7a1eee512299f97d20ad1dc8673ea30eed31a5872d01e3c0724b1a487e2fe6218379
|
7
|
+
data.tar.gz: 8c76e2f2dd336d9c9a448c99cf6ea2743727ee98f79018a0f7d30cce6fa3a9896b1c778f9711788e83c291c843ea4bab58ec6f4f873d72c41a25ada19073e7b9
|
data/lib/thread/delay.rb
CHANGED
@@ -50,11 +50,11 @@ class Thread::Delay
|
|
50
50
|
# In case the block raises an exception, it will be raised, the exception is
|
51
51
|
# cached and will be raised every time you access the value.
|
52
52
|
def value
|
53
|
-
|
53
|
+
@mutex.synchronize {
|
54
|
+
raise @exception if instance_variable_defined? :@exception
|
54
55
|
|
55
|
-
|
56
|
+
return @value if instance_variable_defined? :@value
|
56
57
|
|
57
|
-
@mutex.synchronize {
|
58
58
|
begin
|
59
59
|
@value = @block.call
|
60
60
|
rescue Exception => e
|
data/thread.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thread
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- meh.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|