From 1555984785221281bc89c6170dc1a58feb582152 Mon Sep 17 00:00:00 2001 From: yaohcn Date: Thu, 13 Aug 2020 17:31:18 +0800 Subject: [PATCH] change to RLock --- extern/sector-storage/stats.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extern/sector-storage/stats.go b/extern/sector-storage/stats.go index ee88898a4..be7cab73b 100644 --- a/extern/sector-storage/stats.go +++ b/extern/sector-storage/stats.go @@ -3,8 +3,8 @@ package sectorstorage import "github.com/filecoin-project/sector-storage/storiface" func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats { - m.sched.workersLk.Lock() - defer m.sched.workersLk.Unlock() + m.sched.workersLk.RLock() + defer m.sched.workersLk.RUnlock() out := map[uint64]storiface.WorkerStats{} @@ -22,8 +22,8 @@ func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats { } func (m *Manager) WorkerJobs() map[uint64][]storiface.WorkerJob { - m.sched.workersLk.Lock() - defer m.sched.workersLk.Unlock() + m.sched.workersLk.RLock() + defer m.sched.workersLk.RUnlock() out := map[uint64][]storiface.WorkerJob{}