diff --git a/config.h b/config.h index c0210b0..5a4b8d7 100644 --- a/config.h +++ b/config.h @@ -17,4 +17,6 @@ typedef struct const_config_t const_config_t; #define TCPOOL_MAXWAITSEC 16 +#define TCPOOL_THREADCNT 32 + #endif diff --git a/server.c b/server.c index 3a0eee1..0d09d92 100644 --- a/server.c +++ b/server.c @@ -51,6 +51,8 @@ static uint8_t _cfg[sizeof(simple_pb_t)+sizeof(config_t)]; uint8_t isopen; /* 是否获得了文件锁 */ \ char data[SERVER_THREAD_BUFSZ] +static volatile uintptr_t is_sending_all[TCPOOL_THREADCNT]; + #define TCPOOL_TOUCH_TIMER_CONDITION (is_sending_all[index]) #define TCPOOL_INIT_ACTION \ @@ -70,8 +72,6 @@ static uint8_t _cfg[sizeof(simple_pb_t)+sizeof(config_t)]; #include "tcpool.h" -static volatile uintptr_t is_sending_all[TCPOOL_THREADCNT]; - /* * check_buffer 检查接收到的数据,结合