程序优化,待测试

This commit is contained in:
2025-11-20 16:48:57 +08:00
parent 914e208513
commit 0209a84ed4
5 changed files with 30 additions and 3 deletions

Binary file not shown.

View File

@@ -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";