程序优化,待测试
This commit is contained in:
Binary file not shown.
@@ -51,6 +51,7 @@ std::atomic<bool> isRunning(true); // 全局运行标志
|
||||
std::atomic<bool> confirm(true); // 发送卡和ID
|
||||
condition_variable runCv;
|
||||
mutex runMutex;
|
||||
mutex envMutex; // 配置锁
|
||||
|
||||
// 媒体对象
|
||||
struct Media
|
||||
@@ -198,6 +199,7 @@ void getMsgCallback(mqtt::const_message_ptr msg)
|
||||
double warn = toDouble(warning_json);
|
||||
double safe = toDouble(safe_json);
|
||||
|
||||
lock_guard<mutex> lk(envMutex);
|
||||
ReadFile rf(filepath);
|
||||
if (!rf.Open()) {
|
||||
cerr << "文件打开失败: " << filepath << "\n";
|
||||
|
||||
Reference in New Issue
Block a user