You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
There was a race possible between FPipe::WaitUntilEmpty and FPipe::ClearTask() which was caused by a race in EventCount between Notify & Wait. That led to a dead-lock on IOS. Fixed by adding a StoreLoad (kinda) barrier into Notify to ensure the proper memory ordering for Counter value. RMW is used as a barrier, but could also be solved with a few seq_cst fences (considered to be less optimal and unsupported by TSan). More details: Thread 1: - ClearTask: fetch_sub-s TaskCount to 0 and goes Notify - Notify: reads count as 0 and exits without any wakes (first bit is not set -> nobody is waiting) Thead 2: - WaitUntilEmpty: first check fails, second check check fails, calls PrepareWait (sets count to 1, returns 0), calls WaitFor with 0 - WaitFor: gets count as 1, count without 1 bit is 0, matches token -> wait for Notify which will never happen. One thread was reading stale data due to memory reordering. #rb anderson.ramos, danny.couture, Devin.Doucette #rnx [CL 36755848 by denys mentiei in 5.5 branch]