thread 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/thread/delay.rb +3 -3
  3. data/thread.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 136683911f76264b8d9c47d66607cd3d5b2d9d34
4
- data.tar.gz: 8e669b7e1cad8f10467f45c56b0e7887b51ab9d8
3
+ metadata.gz: acd751cb226565073139b06c1ca6594027b8b62e
4
+ data.tar.gz: 2a7a2de127998b53448104cd363349baba61506b
5
5
  SHA512:
6
- metadata.gz: 657218c2a64a1ef1e5593a6b73d3f29abe376d6c31757220aed94bb742abcd2aa0c743c9dfe1aa168839c0d9d547d01361ddea351db206c6b8a1d140fc53a316
7
- data.tar.gz: b2546abceef43fd444a6acfb950abae2c5c164cab5bd4733b1296fa836ee7dde616fa80af86856f643a4d485363428b61dbaebecfb53e7acdfc9b7dadf03d4ee
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
- raise @exception if exception?
53
+ @mutex.synchronize {
54
+ raise @exception if instance_variable_defined? :@exception
54
55
 
55
- return @value if realized?
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new {|s|
2
2
  s.name = 'thread'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.author = 'meh.'
5
5
  s.email = 'meh@schizofreni.co'
6
6
  s.homepage = 'http://github.com/meh/ruby-thread'
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.0
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-06-27 00:00:00.000000000 Z
11
+ date: 2013-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec