Black screen after Ubuntu update from 18.04 to 20.04

The problem was in this part: that was happening in DIFFERENT thread, which is undefined behavior, refer SDL_Renderer calls from different thread possible? for more info.