Optick::Update acquires coreLock and then tries to acquire UpdateCriticalSection lock if the capture has been stopped, while FOptickPlugin::OnEndFrameRT locks UpdateCriticalSection first and then tries to acquire coreLock, which results in a deadlock.
The proposed solution is to acquire UpdateCriticalSection lock each time coreLock is about to be acquired
This PR fixes an issue described here: https://github.com/bombomby/optick/issues/170
Optick::Update acquires coreLock and then tries to acquire UpdateCriticalSection lock if the capture has been stopped, while FOptickPlugin::OnEndFrameRT locks UpdateCriticalSection first and then tries to acquire coreLock, which results in a deadlock.
The proposed solution is to acquire UpdateCriticalSection lock each time coreLock is about to be acquired