fix UT:concurrent map iteration and map write

This commit is contained in:
jianzhiyao 2020-10-29 18:57:16 +08:00
parent 759982b3b8
commit 508105d32a

View File

@ -452,9 +452,11 @@ func (m *taskManager) StartTask() {
func (m *taskManager) run() {
now := time.Now().Local()
m.taskLock.Lock()
for _, t := range m.adminTaskList {
t.SetNext(nil, now)
}
m.taskLock.Unlock()
for {
// we only use RLock here because NewMapSorter copy the reference, do not change any thing