mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-08 13:50:20 +00:00
sceKernelSignalSema only added to the count and woke the waiters, each of which then had to take the count itself. A sceKernelPollSema or sceKernelWaitSema that ran first took the tokens instead, so a thread that had queued for them could time out or keep waiting. #4899 fixes the same steal for event flags. sceKernelSignalSema now hands its tokens to the queued waiters in the order they queued, passing over one that needs more than is left, and only what remains stays on the count. sceKernelCancelSema reports the queued waiters and cancels them. shadPS4's semaphore serves its wait list the same way when it is signalled.