Parent: #12, #1. Related: #17.
Goal
Make Promise.all, Promise.allSettled, Promise.any, Promise.allKeyed, and Promise.allSettledKeyed aggregation records safe under shared-realm no-GIL settlement from multiple agents.
Why this is separate from #17
Issue #17 tracks direct Object.elements side doors. The result-array element writes are being migrated to locked element helpers, but the combinator aggregation record itself still has mutable shared fields:
promise.Combine.remaining- per-element
alreadyrecords shared by resolve/reject closures - final-settlement ordering / first-wins behavior across racing reactions
Those need their own synchronization story, because locking only the result array does not make the aggregation record itself race-free.
Acceptance criteria
- Add a lock, atomics, or equivalent synchronization around combinator aggregation state.
- Preserve Promise combinator semantics: per-element resolve/reject closure runs at most once; first rejection/fulfillment wins where specified; final settlement fires exactly once.
- Do not hold an aggregation lock across user JS callbacks or capability resolve/reject calls; compute/publish state under the lock, then call out after releasing it.
- Add focused parallel/no-GIL or TSan coverage for concurrently settling inputs.
- Update threading docs with the final ruling.