mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-03 12:57:27 +00:00
QueueForDeliveryDrain ran after ResumeThread with no coordination with the target's final ReapDeliveryDrain: a target could exit between resume and enqueue, leaving the post in a box nothing would drain again and retaining the QueuedDelivery reference. Admission is now decided under drainBoxesLock against the target's _finished flag, which is stored before the final reap in program order; denied posts run their callback inline so the entry and the reference are resolved exactly once on either path. The GuestRaiseException regression arms a post hook, holds the producer between resume and enqueue, lets the target finish and reap, then completes the post and requires the drain to stay empty; the churn rounds also assert the post hook observed mailbox posts alongside the delivered raises.