mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-23 15:48:21 +00:00
764440e017
MacOS requires some UI-related API calls to happen on the main thread. There are several SDL functions that call UI-things, and those were, since #500 /08b4d96cf2, in a separate thread. This crashes on Catalina, instead of simply warning (see #5470). It is not the first time we had such issues, as originally the Engine was on the main thread and AtlasUI on a separate thread. That didn't work on MacOS, so the threading was inverted in #500 /08b4d96cf2, with AtlasUI on the main thread and the Engine in another thread. Unfortunately, this still wasn't enough. This formally unthreads the engine, running it on a wxTimer, to avoid these issues. Future work should focus on: - Further decoupling the simulation from the engine itself, as what Atlas really needs is a threaded simulation, not a threaded engine. - Making the simulation itself more threaded - Making it possible to do tasks asynchronously under Atlas. Refs #500 Fixes #5470 Differential Revision: https://code.wildfiregames.com/D2752 This was SVN commit r24361.