1
0
mirror of https://github.com/fumiama/simple-http-server.git synced 2026-06-05 00:30:23 +08:00

fix: possible concurrent errors

This commit is contained in:
源文雨
2026-01-29 01:36:03 +08:00
parent 5d157c0f32
commit 80c4c982dd
2 changed files with 163 additions and 21 deletions

View File

@@ -259,7 +259,7 @@ static void accept_timer(void *p) {
uint32_t index = timer->index;
pthread_t thread = timer->thread;
uint8_t isbusy;
const time_t check_interval = TCPOOL_MAXWAITSEC / 4;
const time_t check_interval = (TCPOOL_MAXWAITSEC / 4) ? (TCPOOL_MAXWAITSEC / 4) : 1;
sleep(check_interval);
while(thread && !pthread_kill(thread, 0)) {