Fix: thread safety issue during exiting the game (#9380)

_exit_game is read by the draw-thread to know when to exit, but
most of the time written by the game-thread.

(cherry picked from commit c12a152ec9)
This commit is contained in:
Patric Stout
2021-06-17 17:58:59 +01:00
committed by Jonathan G Rennison
parent 573ab48e9c
commit 441ff7e436
3 changed files with 6 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ bool _right_button_clicked; ///< Is right mouse button clicked?
DrawPixelInfo _screen;
bool _screen_disable_anim = false; ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot)
bool _check_special_modes;
bool _exit_game;
std::atomic<bool> _exit_game;
GameMode _game_mode;
SwitchMode _switch_mode; ///< The next mainloop command.
PauseMode _pause_mode;