From 651df6e390b3f20c217ae5a53b346bfbad5d1047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Fri, 1 Dec 2023 11:14:41 +0900 Subject: [PATCH] optimize: keep timer on send_all --- config.h | 2 ++ server.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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 检查接收到的数据,结合