Make Core::started thread safe

develop
Pauli 2018-07-07 13:13:55 +03:00 committed by lethosor
parent 0ed5c8db39
commit 0605b9601c
2 changed files with 3 additions and 2 deletions

@ -1529,6 +1529,7 @@ Core::Core() :
HotkeyMutex{},
HotkeyCond{},
alias_mutex{},
started{false},
misc_data_mutex{},
CoreSuspendMutex{},
CoreWakeup{},
@ -1538,7 +1539,7 @@ Core::Core() :
// init the console. This must be always the first step!
plug_mgr = 0;
errorstate = false;
started = false;
vinfo = 0;
memset(&(s_mods), 0, sizeof(s_mods));
// set up hotkey capture

@ -283,7 +283,7 @@ namespace DFHack
df::viewscreen *top_viewscreen;
bool last_pause_state;
// Very important!
bool started;
std::atomic<bool> started;
// Additional state change scripts
std::vector<StateChangeScript> state_change_scripts;