parallel 1.16.0 → 1.16.1

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
  SHA256:
3
- metadata.gz: bedc98448e417d72b0c170df7c9dcfa3fd64335322ff3edd99ed150cec2f9522
4
- data.tar.gz: edaed373b40aea133d0d636d8ada412bf9098f348848c8db425f5cec5f041fc4
3
+ metadata.gz: b9d71c7c1cb0ec5616b0e53cc1e7e04f4243046a05e43ccd3450aea7623e66a7
4
+ data.tar.gz: 0ba58d01bcc3b2150f82deccc4937e2977e1428dddf89d88ecdb99163be58540
5
5
  SHA512:
6
- metadata.gz: 06b5637f0b775d651c0e9f9621a6537b8aab6cd162122e8fb6c9ce20b9628ae5bae81b2026a60622d6471f357aa11db5599b08ba69922e38eabfbb0e12d6a402
7
- data.tar.gz: 2a0d3683170330b7c7314f00ab55161f3c8902d13a0f9b9a1ee3968c55b7ba30a0d48d8bd513e76825f54419ac47024d8193534bf0f8ec01b5db80d7c9c31c4e
6
+ metadata.gz: 28b1580182981900e12c8e1e839395e6e37fce2f0d5e953931a80a92e6f4d1496abe4c626f7344194674a7432f9c0956556353a3764d5d6ff4bb9f1ca20fd813
7
+ data.tar.gz: 71740d5aea1407881bc1415cad4b959e21538df22308f609f6d5becbf3dd32cc8427057ff845b1a91614ec2da867fae8604b6495b353b7e40dc07de678500dfe
@@ -44,9 +44,10 @@ module Parallel
44
44
 
45
45
  class Worker
46
46
  attr_reader :pid, :read, :write
47
- attr_accessor :thread
47
+ attr_accessor :thread, :lap
48
48
  def initialize(read, write, pid)
49
49
  @read, @write, @pid = read, write, pid
50
+ @lap = 0
50
51
  end
51
52
 
52
53
  def stop
@@ -380,9 +381,8 @@ module Parallel
380
381
  break unless index
381
382
 
382
383
  if options[:isolation]
383
- lap ||= 0
384
- lap += 1
385
- replace_worker(job_factory, workers, i, options, blk) if lap > 1
384
+ worker = replace_worker(job_factory, workers, i, options, blk) if worker.lap > 0
385
+ worker.lap += 1
386
386
  worker.thread = Thread.current
387
387
  end
388
388
 
@@ -414,7 +414,7 @@ module Parallel
414
414
  options[:mutex].synchronize do
415
415
  # old worker is no longer used ... stop it
416
416
  worker = workers[i]
417
- worker.stop if worker
417
+ worker.stop
418
418
 
419
419
  # create a new replacement worker
420
420
  running = workers - [worker]
@@ -1,3 +1,3 @@
1
1
  module Parallel
2
- VERSION = Version = '1.16.0'
2
+ VERSION = Version = '1.16.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-26 00:00:00.000000000 Z
11
+ date: 2019-03-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michael@grosser.it