thread 0.0.8 → 0.0.8.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/pool.rb +7 -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: b8caeb122b45ef1fbfce75eae1c2f313ff356060
4
- data.tar.gz: 5e851cb4ac1a270cf461fe4e4658168aac1bdb0b
3
+ metadata.gz: 4d257856d0bf60a4515f3512f44e1ca7f72ac22c
4
+ data.tar.gz: 99094a0eff5d5e031230d872a67f30730d025730
5
5
  SHA512:
6
- metadata.gz: e54a7cab6bfbb3144a2aa506804d5f9a4ea7b38c42f2e9ff2a55ace0dc0fce6a8554fa0de251041fa8fad8e481f70daf037076a9f9ef15d09fcd3394dd124739
7
- data.tar.gz: 64b5e21bff244a09cd7fa5696d87533a7cfe0bd5622de3143c6b53a4d9c396abd43c0e0a5fdea8172dc64419419a4bf8b7fde93a11f7e7f7ee2be9aec6ddbcfe
6
+ metadata.gz: dbe9b316f2bdd6b3c141180de8be77bd8a62ffa2ddfee531a6f63bc39bcc3b0ca263688037549c6b3c479a55f4ab710112871da4ed3f4e7070fd8eab6e8ee622
7
+ data.tar.gz: ac27c137c50fdc797ca56a0ebf6d2578634dcc86d007959fc3f55bf2ad0ba5f2d4715c04e1bb9de3f3134cab47efb18091e7571bdb661c049cf90ecd934d1521
data/lib/thread/pool.rb CHANGED
@@ -249,7 +249,11 @@ class Thread::Pool
249
249
 
250
250
  # Join on all threads in the pool.
251
251
  def join
252
- @workers.first.join until @workers.empty?
252
+ until @workers.empty?
253
+ if worker = @workers.first
254
+ worker.join
255
+ end
256
+ end
253
257
 
254
258
  self
255
259
  end
@@ -304,9 +308,9 @@ private
304
308
  @waiting += 1
305
309
  @cond.wait @mutex
306
310
  @waiting -= 1
311
+ end
307
312
 
308
- break !shutdown?
309
- end or break
313
+ break if @todo.empty? && shutdown?
310
314
  end
311
315
 
312
316
  @todo.shift
data/thread.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new {|s|
2
2
  s.name = 'thread'
3
- s.version = '0.0.8'
3
+ s.version = '0.0.8.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.0.8
4
+ version: 0.0.8.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-05-16 00:00:00.000000000 Z
11
+ date: 2013-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec