Base: Make some items atomic

This commit is contained in:
tt2468 2021-09-30 19:14:17 -07:00
parent 9f71e4af2c
commit 981538aa2a
3 changed files with 9 additions and 2 deletions

View File

@ -19,8 +19,8 @@ class Config {
bool FirstLoad;
bool ServerEnabled;
uint16_t ServerPort;
bool DebugEnabled;
bool AlertsEnabled;
std::atomic<bool> DebugEnabled;
std::atomic<bool> AlertsEnabled;
bool AuthRequired;
QString ServerPassword;

View File

@ -102,3 +102,8 @@ os_cpu_usage_info_t* GetCpuUsageInfo()
{
return _cpuUsageInfo;
}
bool IsDebugMode()
{
return !_config || _config->DebugEnabled;
}

View File

@ -53,3 +53,5 @@ WebSocketServerPtr GetWebSocketServer();
EventHandlerPtr GetEventHandler();
os_cpu_usage_info_t* GetCpuUsageInfo();
bool IsDebugMode();