Skip to content

Commit

Permalink
statistics: remove h.mu.Lock when creating NewSessionStatsCollector (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyifangreeneyes authored Jun 8, 2023
1 parent 3c50d51 commit ef1b724
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions statistics/handle/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit ef1b724

Please sign in to comment.