From f34e905902d2d71bd2eaf9d9de857ed6bef44877 Mon Sep 17 00:00:00 2001 From: isluckys <152280768+isluckys@users.noreply.github.com> Date: Thu, 19 Jun 2025 01:56:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtask=E6=B3=84=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit signal包里面SetTimeout方法并发时可能会出现task close以后执行start导致泄露 --- common/signal/timer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/signal/timer.go b/common/signal/timer.go index a7f59cd9..ece9f496 100644 --- a/common/signal/timer.go +++ b/common/signal/timer.go @@ -67,9 +67,9 @@ func (t *ActivityTimer) SetTimeout(timeout time.Duration) { t.checkTask.Close() } t.checkTask = checkTask - t.Unlock() t.Update() common.Must(checkTask.Start()) + t.Unlock() } func CancelAfterInactivity(ctx context.Context, cancel context.CancelFunc, timeout time.Duration) *ActivityTimer {