Emulator Issues #9526
closedRace conditions in netplay
0%
Description
The netplay functionality has one or more latent race conditions associated with sharing resources between the main thread and netplay thread(s). This used to manifest consistently when traversal became inaccessible during emulation - the messagebox routine would block and if the user did not click it quickly enough, it caused a crash.
I've submitted a pull request that should more or less take care of the messagebox routine during netplay, however, the latent race condition will be completely unaffected by this. The crashes resulting from it should be reduced in frequency.
It's not really a good idea to run PanicAlertT in constructor code as it may do things like block. My preference would be to throw an exception to indicate a failure and propagate the failure up to a level where it can be handled appropriately. In lieu of that, the design of the core code should account for the fact that the function may fail and it should be moved out of the constructor and placed into the API in some way. Whether that be a TryConnect function or something to that effect.