mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-30 12:25:49 +00:00
AmmSubmit_nid_no_patch stored the id _submit returned into lastSubmit after _submit had released the queue's submit lock. Two submitters could store out of order: the later id was stored first, then the earlier one overwrote it, and a wait for the later, already submitted id failed with ESRCH until the next submission. The wait now checks the id against the AMM queue's own submitted count, which _submit raises under the queue mutex before it returns, and lastSubmit goes. The test has four threads submit empty AMM buffers while another waits on the newest id any of them has published, through sceKernelWaitCommandBufferCompletion and sceAmprAmmWaitCommandBufferCompletion, and requires every wait to succeed.