1
0
forked from 0ad/0ad
0ad/source/tools/atlas
wraitii 764440e017 Remove the Engine threading when using Atlas
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.
2020-12-10 09:42:58 +00:00
..
AtlasFrontends Migrate to premake5, fixes #3729. 2017-10-30 13:52:05 +00:00
AtlasObject Fix most of the new vs2017 induced warnings. 2020-11-26 22:28:50 +00:00
AtlasUI Remove the Engine threading when using Atlas 2020-12-10 09:42:58 +00:00
GameInterface Remove the Engine threading when using Atlas 2020-12-10 09:42:58 +00:00