Files
UnrealEngineUWP/Engine/Source/Runtime/Core/Private/FileCache
eric mcdaniel 3d26336c66 Fix for potential deadlock in shader preloads
FPreloadShaderTask takes the ShaderPreloadLock in FShaderCodeArchive::OnShaderPreloadFinished() and then issues an async read.  Another task can be picked up by the thread while waiting on that read.  If that new task is also a FPreloadShaderTask it will try to aquire the ShaderPreloadLock again and deadlock.

Introduce an EnsureReadNonBlocking method to IMemoryReadStream which can be called outside the lock to ensure the data is ready.  We can then lock and copy out the data without incuring a wait and the potential for another FPreloadShaderTask being run while we hold the lock.

#rb Ben.Ingram, Michal.Valient


#ROBOMERGE-SOURCE: CL 16917416
#ROBOMERGE-BOT: (v836-16769935)

[CL 16924675 by eric mcdaniel in ue5-main branch]
2021-07-22 11:45:06 -04:00
..