weel 1.99.97 → 1.99.98

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/weel.rb +23 -2
  3. data/weel.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 357f0f0172e195152fffb470efa58627a6824d5ec034a9fbb9c005afc2a4682b
4
- data.tar.gz: ea501b321add0fb22f677fb61d39c0515c0054168959cecba02f7707fc7a0dd4
3
+ metadata.gz: 9e82bd07a1a46e7456badf0f68f51b61ce8185c4292590e2c3113e3dcef9b23b
4
+ data.tar.gz: a8e5dc3301a874267a5742395816501d778c2b7ccd934590c55e28410c34994e
5
5
  SHA512:
6
- metadata.gz: 731c6bd0b2ce102011fd30cc95565554b2bd28e316a15c6db7450597c30620644656b68a803016fd69e25b79b580abda4e6110e46c904edf18aa3c33a9374f31
7
- data.tar.gz: 151781be93c788dd63b04ca9cc4cc1aab423c3245b30da95b3f148573baa6689e542d7b85fd59d13437c99a2331ef8fa39baf23c7420bd08b387c344c9987d81
6
+ metadata.gz: 8b37432797796439fcff05c476d09f1c3f7ee388f01a83e593c9db8fcb7bc57f413f5809f0a48c31b2ba04f146928ec236a87e6e5e1ca78a487c7eccbfcb82a2
7
+ data.tar.gz: be8e00b7a57362406dfd61d9c84d53ad2451f7219c535c0a2e4562eedd527dba6ca50c32a735e8d898e959eeb6ac9e120ab9e6507f476dfebe9e96cbaa22d60f
data/lib/weel.rb CHANGED
@@ -417,7 +417,9 @@ class WEEL
417
417
 
418
418
  __weel_protect_yield(&block)
419
419
 
420
- Thread.current[:branch_wait_count] = (type.is_a?(Hash) && type.size == 1 && type[:wait] != nil && (type[:wait].is_a?(Integer) && type[:wait] > 0) ? type[:wait] : Thread.current[:branches].size)
420
+ Thread.current[:branch_wait_count] = (type.is_a?(Hash) && type[:wait] != nil && (type[:wait].is_a?(Integer) && type[:wait] > 0) ? type[:wait] : Thread.current[:branches].size)
421
+ Thread.current[:branch_wait_count_cancel] = 0
422
+ Thread.current[:branch_wait_count_cancel_condition] = (type.is_a?(Hash) && type[:cancel] != nil && type[:cancel] == :first ) ? :first : :last
421
423
  1.upto Thread.current[:branches].size do
422
424
  Thread.current[:branch_event].wait
423
425
  end
@@ -460,11 +462,12 @@ class WEEL
460
462
  current_branch_sim_pos = branch_parent[:branch_sim_pos]
461
463
  end
462
464
 
463
- Thread.current[:branches] << Thread.new(*vars) do |*local|
465
+ branch_parent[:branches] << Thread.new(*vars) do |*local|
464
466
  Thread.current.abort_on_exception = true
465
467
  Thread.current[:branch_status] = false
466
468
  Thread.current[:branch_parent] = branch_parent
467
469
  Thread.current[:start_event] = Continue.new
470
+ Thread.current[:branch_wait_count_cancel_active] = false
468
471
 
469
472
  if __weel_sim
470
473
  Thread.current[:branch_sim_pos] = @__weel_sim += 1
@@ -872,6 +875,24 @@ class WEEL
872
875
  self.__weel_state = :stopping
873
876
  ensure
874
877
  handlerwrapper.mem_guard unless handlerwrapper.nil?
878
+ if Thread.current[:branch_parent]
879
+ Thread.current[:branch_parent][:mutex].synchronize do
880
+ if Thread.current[:branch_parent][:branch_wait_count_cancel_condition] == :first
881
+ if !Thread.current[:branch_wait_count_cancel_active]
882
+ Thread.current[:branch_wait_count_cancel_active] = true
883
+ Thread.current[:branch_parent][:branch_wait_count_cancel] += 1
884
+ end
885
+ if Thread.current[:branch_parent][:branch_wait_count_cancel] == Thread.current[:branch_parent][:branch_wait_count] && self.__weel_state != :stopping && self.__weel_state != :finishing
886
+ Thread.current[:branch_parent][:branches].each do |thread|
887
+ if thread.alive? && thread != Thread.current
888
+ thread[:nolongernecessary] = true
889
+ __weel_recursive_continue(thread)
890
+ end
891
+ end
892
+ end
893
+ end
894
+ end
895
+ end
875
896
  Thread.current[:continue].clear if Thread.current[:continue] && Thread.current[:continue].is_a?(Continue)
876
897
  end
877
898
  end # }}}
data/weel.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "weel"
3
- s.version = "1.99.97"
3
+ s.version = "1.99.98"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Workflow Execution Engine Library (WEEL)"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.99.97
4
+ version: 1.99.98
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-05-03 00:00:00.000000000 Z
12
+ date: 2021-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit