From ac2aba0faf145a40b2062cb1819c9b4474d069c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 1 Apr 2025 11:07:28 +0800 Subject: [PATCH] Threading: fix timeout calcuation --- src/common/thread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/thread.h b/src/common/thread.h index 4d25dd505..deb4fba15 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -65,8 +65,8 @@ struct timespec ts; if (clock_gettime(CLOCK_REALTIME, &ts) == 0) { - ts.tv_sec += ts.tv_sec / 1000; - ts.tv_nsec += (ts.tv_nsec % 1000) * 1000000; + ts.tv_sec += timeout / 1000; + ts.tv_nsec += (timeout % 1000) * 1000000; if (pthread_timedjoin_np(thread, NULL, &ts) != 0) { pthread_kill(thread, SIGTERM);