modify threads
This commit is contained in:
@@ -4415,7 +4415,7 @@ void check_recall_event() {
|
||||
}
|
||||
}
|
||||
|
||||
if (had_items_before && popped_any && lm.recall_list.empty()) {//处理后,当前测点补招记录为空
|
||||
if (had_items_before && popped_any && lm.recall_list.empty()) {//处理后,当前测点补招记录为空
|
||||
//通知补招全部完成
|
||||
std::cout << "[check_recall_event] finish recall monitor=" << lm.monitor_id << std::endl;
|
||||
//读取记录文件获取响应参数
|
||||
@@ -4480,7 +4480,6 @@ void check_recall_event() {
|
||||
dev.busytimecount = 0; // 计时归零
|
||||
continue; //处理完处理下一个装置
|
||||
}
|
||||
|
||||
|
||||
|
||||
//有待补招任务,且idle或者在补招,继续补招处理
|
||||
|
||||
@@ -678,8 +678,9 @@ void cleanup_args(ThreadArgs* args) {
|
||||
}
|
||||
|
||||
void* cloudfrontthread(void* arg) {
|
||||
///////////////////////////////////////
|
||||
ThreadArgs* args = static_cast<ThreadArgs*>(arg);
|
||||
|
||||
//不再需要入参20251208
|
||||
/*ThreadArgs* args = static_cast<ThreadArgs*>(arg);
|
||||
int argc = args->argc;
|
||||
char **argv = args->argv;
|
||||
|
||||
@@ -697,7 +698,9 @@ void* cloudfrontthread(void* arg) {
|
||||
std::cerr << "[cloudfrontthread] Failed to parse index from argv[0]: " << argv[0] << "\n";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
(void)arg;
|
||||
const int index = 0;
|
||||
|
||||
// 更新线程状态为运行中
|
||||
pthread_mutex_lock(&thread_info[index].lock);
|
||||
@@ -705,8 +708,7 @@ void* cloudfrontthread(void* arg) {
|
||||
thread_info[index].state = THREAD_RUNNING;
|
||||
pthread_mutex_unlock(&thread_info[index].lock);
|
||||
|
||||
///////////////////////////////////////
|
||||
// 解析命令行参数
|
||||
/*// 解析命令行参数
|
||||
if(!parse_param(argc,argv)){
|
||||
std::cerr << "process param error,exit" << std::endl;
|
||||
cleanup_args(args);
|
||||
@@ -714,7 +716,7 @@ void* cloudfrontthread(void* arg) {
|
||||
}
|
||||
|
||||
// 线程使用完后清理参数
|
||||
cleanup_args(args);
|
||||
cleanup_args(args);*/
|
||||
|
||||
//路径获取
|
||||
FRONT_PATH = get_parent_directory();
|
||||
@@ -787,6 +789,12 @@ void* cloudfrontthread(void* arg) {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(60));//每分钟检测一次
|
||||
}
|
||||
|
||||
// 退出前标记为 STOPPED,方便监控线程判断并重启
|
||||
pthread_mutex_lock(&thread_info[index].lock);
|
||||
thread_info[index].state = THREAD_STOPPED;
|
||||
printf("cloudfrontthread %d stopped\n", index);
|
||||
pthread_mutex_unlock(&thread_info[index].lock);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user