From aac62ec996d10740dac28e6a3d37d781db502d4d Mon Sep 17 00:00:00 2001 From: xuyifan <675434007@qq.com> Date: Thu, 8 Jun 2023 12:51:50 +0800 Subject: [PATCH] remove h.mu.Lock when creating NewSessionStatsCollector --- statistics/handle/update.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/statistics/handle/update.go b/statistics/handle/update.go index 78dfa5878324a..7cdc3267965c2 100644 --- a/statistics/handle/update.go +++ b/statistics/handle/update.go @@ -234,9 +234,6 @@ func (s *SessionStatsCollector) UpdateColStatsUsage(colMap colStatsUsageMap) { // NewSessionStatsCollector allocates a stats collector for a session. func (h *Handle) NewSessionStatsCollector() *SessionStatsCollector { - h.mu.Lock() - defer h.mu.Unlock() - h.listHead.Lock() defer h.listHead.Unlock() newCollector := &SessionStatsCollector{ @@ -315,8 +312,6 @@ func (s *SessionIndexUsageCollector) Delete() { // idxUsageListHead always points to an empty SessionIndexUsageCollector as a sentinel node. So we let idxUsageListHead.next // points to new item. It's helpful to sweepIdxUsageList. func (h *Handle) NewSessionIndexUsageCollector() *SessionIndexUsageCollector { - h.mu.Lock() - defer h.mu.Unlock() h.idxUsageListHead.Lock() defer h.idxUsageListHead.Unlock() newCollector := &SessionIndexUsageCollector{