未验证 提交 8f160985 编写于 作者: M Ming Deng 提交者: GitHub

Merge pull request #4306 from AllenX2018/fix-issue-4305

fix issue #4305: add write lock for map adminTaskList iteration and modify
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册