proton download loop workaround
This PR is provided as a reference to the 99.9% stuck issue on proton, as SesbianLex42069 (snarky-ly) pointed out that it is possible for the download to get stuck indefinitely at https://forum.beammp.com/t/linux-setup-beammp-proton-with-steamtinkerlaunch/688297/27, as well as https://discord.com/channels/601558901657305098/1244002666384986112/1244002666384986112
Stopping the async update thread explicitly to avoid it getting stuck due to ~~floating point conversion quirks~~ race condition on incrementing GRcv
Not sure how useful this will still be after the big launcher rewrite that is going on, just leaving this here as a reference
Tested working inside proton after helping the launcher find the game install with regedit, I can download mods during server joining without getting stuck at 99.9% with this change
Oh my god why do we even have floating point stuff in there, I'm going to scream. Thank you, I'll look into this.
Actually it’s likely race condition on GRcv’s increment instead of floating point quirk
I'm not sure I can reproduce the issue, actually!
It might have to do with differences in wine's vcruntime*.dll and msvcrt.dll compared to windows, or linux itself, having slight difference when it comes to incrementing a non atomic variable on two different threads without any use of mutex
I'm rather surprised by how no one had the same issue on windows, since it happens a lot in wine with moderately sized files, and writing a non atomic variable on two threads without locks requires compilers to increment variables atomically by default
aka its undefined behavior and its a data race, yeah. I don't know why it was written like this.
This should be fixed since we've now just gotten rid of the other thread entirely, that was stupid design. Thank you for your contribution, it pointed out some bigger issues!