Merge branch '测试2' of http://192.168.1.22:3000/zw/Linux_Front1056 into 测试2
This commit is contained in:
@@ -7,7 +7,11 @@
|
||||
#include "PQSMsg.h"
|
||||
#include "client2.h"
|
||||
#include "dealMsg.h"
|
||||
|
||||
#include "cloudfront/code/interface.h"
|
||||
|
||||
using namespace std;
|
||||
#if 0
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#define THREAD_CONNECTIONS 10 // <20><><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3><EFBFBD>
|
||||
#define MONITOR_INTERVAL 1 // <20><><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD>(<28><>)
|
||||
@@ -27,7 +31,7 @@ typedef struct {
|
||||
thread_state_t state; // <20><>ǰ״̬
|
||||
pthread_mutex_t lock; // <20>߳<EFBFBD>ר<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
||||
} thread_info_t;
|
||||
|
||||
#endif
|
||||
/* ȫ<>ֱ<EFBFBD><D6B1><EFBFBD> */
|
||||
thread_info_t thread_info[THREAD_CONNECTIONS]; // <20>߳<EFBFBD><DFB3><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
||||
pthread_mutex_t global_lock = PTHREAD_MUTEX_INITIALIZER; // ȫ<>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -234,6 +238,19 @@ void restart_thread(int index) {
|
||||
free(new_index);
|
||||
}
|
||||
}
|
||||
else if (index == 2) {
|
||||
// <20>ӿڣ<D3BF>mq
|
||||
char* argv[] = { (char*)new_index ,(char*)"-dcfg_stat_data", (char*)"-s1_1" };
|
||||
ThreadArgs* args = new ThreadArgs{3, argv};
|
||||
if (pthread_create(&thread_info[index].tid, NULL, cloudfrontthread, args) != 0) {
|
||||
pthread_mutex_lock(&global_lock);
|
||||
printf("Failed to restart message processor thread %d\n", index);
|
||||
thread_info[index].state = THREAD_CRASHED;
|
||||
pthread_mutex_unlock(&global_lock);
|
||||
delete args; // <20><><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6>ͷ<EFBFBD>
|
||||
free(new_index);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>ʵ<EFBFBD><CAB5>Ӧ<EFBFBD><D3A6><EFBFBD>п<EFBFBD><D0BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
|
||||
|
||||
Reference in New Issue
Block a user