potential fix for Windows 7 freeze on exit

This commit is contained in:
Ryzerth
2021-07-29 15:07:22 +02:00
parent 7079ddb74e
commit b7a0f849cf
4 changed files with 38 additions and 30 deletions

View File

@ -4,6 +4,7 @@
#include <string>
#include <mutex>
#include <condition_variable>
#include <atomic>
using nlohmann::json;
@ -17,21 +18,21 @@ public:
void enableAutoSave();
void disableAutoSave();
void acquire();
void release(bool changed = false);
void release(bool modified = false);
json conf;
private:
static void autoSaveWorker(ConfigManager* _this);
void autoSaveWorker();
std::string path = "";
bool changed = false;
bool autoSaveEnabled = false;
volatile bool changed = false;
volatile bool autoSaveEnabled = false;
std::thread autoSaveThread;
std::mutex mtx;
std::mutex termMtx;
std::condition_variable termCond;
bool termFlag = false;
volatile bool termFlag = false;
};