From 3781105f7c1803211bfba8c2d7207ec3b27b9afb Mon Sep 17 00:00:00 2001 From: okJiang <819421878@qq.com> Date: Mon, 18 Dec 2023 16:55:45 +0800 Subject: [PATCH] fix comment --- pkg/disttask/framework/taskexecutor/slot.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/disttask/framework/taskexecutor/slot.go b/pkg/disttask/framework/taskexecutor/slot.go index 73a3d690cd0ac..cb9a34ef606c2 100644 --- a/pkg/disttask/framework/taskexecutor/slot.go +++ b/pkg/disttask/framework/taskexecutor/slot.go @@ -63,5 +63,8 @@ func (sm *slotManager) unReserve(taskID int64) { // canReserve is used to check whether the instance has enough slots to run the task. func (sm *slotManager) canReserve(task *proto.Task) bool { + sm.Lock() + defer sm.Unlock() + return sm.available >= task.Concurrency }