Commit dd05f14
committed
einsum: fence sub-Worlds before destruction (incl. on exception unwind)
Add an inline RAII guard `FenceSubWorldsOnExit` to the generalized-
contraction path of einsum, declared right after the `worlds` vector so
it destructs *before* `worlds` (LIFO) and *after* AB/C. On normal exit
this is a second harmless fence; on exception unwind it drains any
`lazy_sync_children` tasks that ~DistArray scheduled via lazy_deleter on
sub-World taskqs before those sub-Worlds are torn down. Without this,
those tasks survive into the global ThreadPool past ~World, then trip
~WorldObject's `World::exists(&world)` assertion when an enclosing
scope's fence runs them, masking the real exception with a cryptic
abort.1 parent f9f3828 commit dd05f14
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
656 | 679 | | |
657 | 680 | | |
658 | 681 | | |
| |||
0 commit comments