parallel 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41798e8a531680e30ebcc41d1fa32527a03b062e
4
- data.tar.gz: 9573be00fe55ad7bfac10b11af093bf729085b24
3
+ metadata.gz: 0e98f73ce25c329aab14185e79d68643dde8b705
4
+ data.tar.gz: bcf7f3490b62a267b9c54b82114c25193fdef811
5
5
  SHA512:
6
- metadata.gz: c11b276f31a4f08ff4d91a33626c0daab3a903d1b1f5e7b0450f3837ab5076cefa9fcd458decff08444d62c4a9f28eb2c9447b7f4f7e7fcafbe96c9e8d53e918
7
- data.tar.gz: 24b9dfdd2058018a3eba26d9cb2177f1fcab0b95517630704facec2ab1c3254251503cb2881e9574f2b13f8cd023ddcd18fa5b71480aa36161fed260bbcf2cf3
6
+ metadata.gz: 6209b06e7fd1a09a92c1e485c156b4abc57ba5c230f21ae6d7df5752d06acaf2adc55771230bda207a37a770b0a3241cad33e0d27da125ed1c8642c848f16633
7
+ data.tar.gz: 6e08572a7a48ce2d5da1e325c02ab701297854fd5e22397835e48d361f86968a79fb764a5c2df91f4cfbf81ff31d9f5bb3ed39ed86f570ffc075c29084fb049f
@@ -1,2 +1,3 @@
1
- c��n<RAI��_�A���X~8D��{ǰP{����s
2
- ��l�U����ȳ���������7Iae&ċIV�ͅ�O��G ����$���(�P��OUW����R���K=�i�\��v�$<�xa��bXԓ䙰�HT�z�< ��w�JLG�w�G��Ym�}���D�BG�M��^�%�W-jϷ���=� �J� r~�U�4y�K�:@��&ɨT�d������o$�D<3>%���c����s�=��㕆�ޠ
1
+ D���N�3SL���{���,���E�v�ܑ ��4)^��|�zo �k��A�!�u7�^��ν4��7R��3�N(��k����mN�`JjN�
2
+ ���G@:�p�L���Z���.�a�����hZ��h]@���h���>�y �ϻ���U�
3
+ �fhZ����3�F�=4t7
data.tar.gz.sig CHANGED
Binary file
@@ -26,7 +26,7 @@ module Parallel
26
26
 
27
27
  class Worker
28
28
  attr_reader :pid, :read, :write
29
- attr_accessor :silent_death
29
+ attr_accessor :thread
30
30
  def initialize(read, write, pid)
31
31
  @read, @write, @pid = read, write, pid
32
32
  end
@@ -52,7 +52,7 @@ module Parallel
52
52
  begin
53
53
  Marshal.load(read)
54
54
  rescue EOFError
55
- raise DeadWorker unless silent_death
55
+ raise DeadWorker
56
56
  end
57
57
  end
58
58
  end
@@ -250,6 +250,7 @@ module Parallel
250
250
  kill_on_ctrl_c(workers.map(&:pid)) do
251
251
  in_threads(options[:count]) do |i|
252
252
  worker = workers[i]
253
+ worker.thread = Thread.current
253
254
 
254
255
  begin
255
256
  loop do
@@ -264,8 +265,10 @@ module Parallel
264
265
  if ExceptionWrapper === output
265
266
  exception = output.exception
266
267
  if Parallel::Kill === exception
267
- workers.each { |w| w.silent_death = true }
268
- kill_everything_we_spawned
268
+ (workers - [worker]).each do |w|
269
+ kill_that_thing!(w.thread)
270
+ kill_that_thing!(w.pid)
271
+ end
269
272
  end
270
273
  else
271
274
  results[index] = output
@@ -364,7 +367,7 @@ module Parallel
364
367
  Signal.trap :SIGINT do
365
368
  if @to_be_killed.any?
366
369
  $stderr.puts 'Parallel execution interrupted, exiting ...'
367
- kill_everything_we_spawned
370
+ @to_be_killed.flatten.compact.each { |thing| kill_that_thing!(thing) }
368
371
  end
369
372
  exit 1 # Quit with 'failed' signal
370
373
  end
@@ -374,13 +377,6 @@ module Parallel
374
377
  @to_be_killed.pop # free threads for GC and do not kill pids that could be used for new processes
375
378
  end
376
379
 
377
- def kill_everything_we_spawned
378
- if defined?(@to_be_killed)
379
- @to_be_killed.flatten.compact.each { |thing| kill_that_thing!(thing) }
380
- @to_be_killed = [] # in case the ctrl+c kicks in later ...
381
- end
382
- end
383
-
384
380
  def kill_that_thing!(thing)
385
381
  if thing.is_a?(Thread)
386
382
  thing.kill
@@ -1,3 +1,3 @@
1
1
  module Parallel
2
- VERSION = Version = '1.1.1'
2
+ VERSION = Version = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -30,7 +30,7 @@ cert_chain:
30
30
  F5etKHZg0j3eHO31/i2HnswY04lqGImUu6aM5EnijFTB7PPW2KwKKM4+kKDYFdlw
31
31
  /0WV1Ng2/Y6qsHwmqGg2VlYj2h4=
32
32
  -----END CERTIFICATE-----
33
- date: 2014-07-17 00:00:00.000000000 Z
33
+ date: 2014-07-18 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description:
36
36
  email: michael@grosser.it
metadata.gz.sig CHANGED
Binary file