change to RLock
This commit is contained in:
parent
7e36188519
commit
1555984785
8
extern/sector-storage/stats.go
vendored
8
extern/sector-storage/stats.go
vendored
@ -3,8 +3,8 @@ package sectorstorage
|
|||||||
import "github.com/filecoin-project/sector-storage/storiface"
|
import "github.com/filecoin-project/sector-storage/storiface"
|
||||||
|
|
||||||
func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats {
|
func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats {
|
||||||
m.sched.workersLk.Lock()
|
m.sched.workersLk.RLock()
|
||||||
defer m.sched.workersLk.Unlock()
|
defer m.sched.workersLk.RUnlock()
|
||||||
|
|
||||||
out := map[uint64]storiface.WorkerStats{}
|
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 {
|
func (m *Manager) WorkerJobs() map[uint64][]storiface.WorkerJob {
|
||||||
m.sched.workersLk.Lock()
|
m.sched.workersLk.RLock()
|
||||||
defer m.sched.workersLk.Unlock()
|
defer m.sched.workersLk.RUnlock()
|
||||||
|
|
||||||
out := map[uint64][]storiface.WorkerJob{}
|
out := map[uint64][]storiface.WorkerJob{}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user